List of usage examples for com.google.gwt.user.client Window open
public static void open(String url, String name, String features)
From source file:org.drools.guvnor.client.widgets.DiscussionWidget.java
License:Apache License
private void showNewCommentButton() { newCommentLayout.clear();//ww w.j av a 2 s .c o m HorizontalPanel hp = new HorizontalPanel(); Button createNewComment = new Button(constants.AddADiscussionComment()); createNewComment.setEnabled(!this.readOnly); hp.add(createNewComment); if (UserCapabilities.INSTANCE.hasCapability(Capability.SHOW_ADMIN)) { Button adminClearAll = new Button(constants.EraseAllComments()); adminClearAll.setEnabled(!readOnly); hp.add(adminClearAll); adminClearAll.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { if (Window.confirm(constants.EraseAllCommentsWarning())) { assetService.clearAllDiscussionsForAsset(artifact.getUuid(), new GenericCallback<java.lang.Void>() { public void onSuccess(Void v) { updateCommentList(new ArrayList<DiscussionRecord>()); } }); } } }); } final String feedURL = GWT.getModuleBaseURL() + "feed/discussion?package=" + ((Asset) artifact).getMetaData().getModuleName() + "&assetName=" + URL.encode(artifact.getName()) + "&viewUrl=" + Util.getSelfURL(); Image image = GuvnorImages.INSTANCE.Feed(); image.addClickHandler(new ClickHandler() { public void onClick(ClickEvent arg0) { Window.open(feedURL, "_blank", null); } }); hp.add(image); newCommentLayout.add(hp); newCommentLayout.setCellHorizontalAlignment(hp, HasHorizontalAlignment.ALIGN_RIGHT); createNewComment.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { showAddNewComment(); } }); }
From source file:org.drools.guvnor.client.widgets.MetaDataWidget.java
License:Apache License
private void loadData() { if (artifact instanceof Asset) { addAttribute(constants.CategoriesMetaData(), categories()); }//from w w w . j a va 2 s. c o m addAttribute(constants.LastModified(), readOnlyDate(artifact.getLastModified())); addAttribute(constants.ModifiedByMetaData(), readOnlyText(artifact.getLastContributor())); addAttribute(constants.NoteMetaData(), readOnlyText(artifact.getCheckinComment())); if (!readOnly) { addAttribute(constants.CreatedOnMetaData(), readOnlyDate(artifact.getDateCreated())); } if (artifact instanceof Asset) { addAttribute(constants.CreatedByMetaData(), readOnlyText(((Asset) artifact).getMetaData().getCreator())); addAttribute(constants.PackageMetaData(), packageEditor(((Asset) artifact).getMetaData().getModuleName())); addAttribute(constants.IsDisabledMetaData(), editableBoolean(new FieldBooleanBinding() { public boolean getValue() { return ((Asset) artifact).getMetaData().isDisabled(); } public void setValue(boolean val) { ((Asset) artifact).getMetaData().setDisabled(val); } }, constants.DisableTip())); } addAttribute(constants.FormatMetaData(), readOnlyText(artifact.getFormat())); addAttribute("UUID:", readOnlyText(uuid)); endSection(false); if (artifact instanceof Asset) { final MetaData data = ((Asset) artifact).getMetaData(); startSection(constants.OtherMetaData()); addAttribute(constants.SubjectMetaData(), editableText(new FieldBinding() { public String getValue() { return data.subject; } public void setValue(String val) { data.subject = val; } }, constants.AShortDescriptionOfTheSubjectMatter())); addAttribute(constants.TypeMetaData(), editableText(new FieldBinding() { public String getValue() { return data.type; } public void setValue(String val) { data.type = val; } }, constants.TypeTip())); addAttribute(constants.ExternalLinkMetaData(), editableText(new FieldBinding() { public String getValue() { return data.externalRelation; } public void setValue(String val) { data.externalRelation = val; } }, constants.ExternalLinkTip())); addAttribute(constants.SourceMetaData(), editableText(new FieldBinding() { public String getValue() { return data.externalSource; } public void setValue(String val) { data.externalSource = val; } }, constants.SourceMetaDataTip())); endSection(true); } startSection(constants.VersionHistory()); Image image = GuvnorImages.INSTANCE.Feed(); image.addClickHandler(new ClickHandler() { public void onClick(ClickEvent arg0) { Window.open(getVersionFeed(artifact), "_blank", null); } }); addAttribute(constants.VersionFeed(), image); addAttribute(constants.CurrentVersionNumber(), getVersionNumberLabel()); if (!readOnly) { addRow(new VersionBrowser(clientFactory, eventBus, this.uuid, !(artifact instanceof Asset))); } endSection(true); }
From source file:org.drools.guvnor.client.widgets.tables.AbstractAssetPagedTable.java
License:Apache License
@UiHandler("feedImage") void openFeed(ClickEvent e) { if (!feedImage.isVisible() || feedURL == null || "".equals(feedURL)) { return;/* www . j a v a 2 s . com*/ } Window.open(feedURL, "_blank", null); }
From source file:org.drools.workbench.screens.dtablexls.client.editor.DecisionTableXLSEditorViewImpl.java
License:Apache License
public void setPath(final Path path) { //Upload widgets final Well uploadWell = new Well(); final HorizontalPanel uploadContainer = new HorizontalPanel(); uploadContainer.add(new Label(DecisionTableXLSEditorConstants.INSTANCE.UploadNewVersion() + ":")); uploadContainer.add(uploadWidget);/*from w w w . j av a 2 s. c o m*/ uploadWell.add(uploadContainer); formStyleLayout.addRow(uploadWell); uploadWidget.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { BusyPopup.showMessage(DecisionTableXLSEditorConstants.INSTANCE.Uploading()); if (concurrentUpdateSessionInfo != null) { newConcurrentUpdate(concurrentUpdateSessionInfo.getPath(), concurrentUpdateSessionInfo.getIdentity(), new org.uberfire.mvp.Command() { @Override public void execute() { submit(path); } }, new org.uberfire.mvp.Command() { @Override public void execute() { //cancel? } }, new org.uberfire.mvp.Command() { @Override public void execute() { presenter.reload(); concurrentUpdateSessionInfo = null; } }).show(); } else { submit(path); } } }); //Download widgets final Well downloadWell = new Well(); final HorizontalPanel downloadContainer = new HorizontalPanel(); downloadContainer.add(new Label(DecisionTableXLSEditorConstants.INSTANCE.DownloadCurrentVersion() + ":")); downloadContainer.add(downloadButton); downloadWell.add(downloadContainer); formStyleLayout.addRow(downloadWell); downloadButton.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { Window.open(URLHelper.getDownloadUrl(path), "downloading", "resizable=no,scrollbars=yes,status=no"); } }); }
From source file:org.drools.workbench.screens.scorecardxls.client.editor.ScoreCardXLSEditorViewImpl.java
License:Apache License
public void setPath(final Path path) { //Upload widgets final Well uploadWell = new Well(); final HorizontalPanel uploadContainer = new HorizontalPanel(); uploadContainer.add(new Label(ScoreCardXLSEditorConstants.INSTANCE.UploadNewVersion() + ":")); uploadContainer.add(uploadWidget);//from w w w .jav a 2s .co m uploadWell.add(uploadContainer); ts.addRow(uploadWell); uploadWidget.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { BusyPopup.showMessage(ScoreCardXLSEditorConstants.INSTANCE.Uploading()); if (concurrentUpdateSessionInfo != null) { newConcurrentUpdate(concurrentUpdateSessionInfo.getPath(), concurrentUpdateSessionInfo.getIdentity(), new org.uberfire.mvp.Command() { @Override public void execute() { submit(path); } }, new org.uberfire.mvp.Command() { @Override public void execute() { //cancel? } }, new org.uberfire.mvp.Command() { @Override public void execute() { concurrentUpdateSessionInfo = null; presenter.reload(); } }).show(); } else { submit(path); } } }); //Download widgets final Well downloadWell = new Well(); final HorizontalPanel downloadContainer = new HorizontalPanel(); downloadContainer.add(new Label(ScoreCardXLSEditorConstants.INSTANCE.DownloadCurrentVersion() + ":")); downloadContainer.add(downloadButton); downloadWell.add(downloadContainer); ts.addRow(downloadWell); downloadButton.addClickHandler(new ClickHandler() { @Override public void onClick(final ClickEvent event) { Window.open(URLHelper.getDownloadUrl(path), "downloading", "resizable=no,scrollbars=yes,status=no"); } }); }
From source file:org.ebayopensource.turmeric.monitoring.client.view.SummaryPanel.java
License:Open Source License
/** * Instantiates a new summary panel.//w ww . jav a 2 s. c o m */ public SummaryPanel() { // the panel where the table and graphs go contentGrid = new Grid(2, 1); contentGrid.setWidth("100%"); contentGrid.setHeight("100%"); contentGrid.setCellPadding(0); contentGrid.setCellSpacing(0); // this is a grid to place the buttons on top of the data table Grid verticalGrid = new Grid(2, 1); verticalGrid.setWidth("100%"); verticalGrid.setHeight("60%"); verticalGrid.setCellPadding(0); verticalGrid.setCellSpacing(0); verticalGrid.getCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_TOP); contentGrid.setWidget(1, 0, verticalGrid); panel = new HorizontalPanel(); panel.addStyleName("summary-panel-item"); Grid headingGrid = new Grid(1, 2); headingLabel = new Label(""); headingGrid.setWidget(0, 0, headingLabel); headingGrid.setWidth("100%"); Grid buttonGrid = new Grid(1, 2); headingGrid.setWidget(0, 1, buttonGrid); headingGrid.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT); infoImg = new Image(); infoImg.setUrl("images/info.png"); infoImgLight = new Image(); infoImgLight.setUrl("images/info-light.png"); PushButton ib = new PushButton(infoImg, infoImgLight); ib.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (info != null) { InfoDialog dialog = new InfoDialog(false); dialog.setMessage(info); int x = infoImg.getAbsoluteLeft(); int y = infoImg.getAbsoluteTop() + infoImg.getOffsetHeight(); dialog.getDialog().setAutoHideEnabled(true); dialog.getDialog().setPopupPosition(x, y); dialog.getDialog().show(); } } }); downloadImg = new Image(); downloadImg.setUrl("images/dwnld.png"); downloadImg.addStyleName("dwnld"); downloadImgLight = new Image(); downloadImgLight.setUrl("images/dwnld-light.png"); PushButton db = new PushButton(downloadImg, downloadImgLight); db.addClickHandler(new ClickHandler() { public void onClick(ClickEvent arg0) { final Element downloadIframe = RootPanel.get("__download").getElement(); if (downloadIframe == null) Window.open(downloadUrl, "_blank", ""); else DOM.setElementAttribute(downloadIframe, "src", downloadUrl); } }); buttonGrid.setWidget(0, 0, ib); buttonGrid.setWidget(0, 1, db); // panel.add(headingGrid); panel.setWidth("99%"); scroller = new ScrollPanel(); scroller.addStyleName("summary-scroll"); scroller.add(contentGrid); scroller.setSize("100%", "100%"); panel.add(scroller); initWidget(panel); setDataTableButtonGrid(headingGrid); }
From source file:org.ebayopensource.turmeric.policy.adminui.client.presenter.policy.PolicySummaryPresenter.java
License:Open Source License
/** * Bind.// w w w .ja va2 s. c om */ public void bind() { // The user wants to search by subject group type + name this.view.addSubjectCriteriaButtonClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { view.setAvailableTypes(fetchSubjectTypes()); } }); // the user wants to search by policy type and name this.view.addPolicyCriteriaButtonClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { view.setAvailableTypes(fetchPolicyTypes()); } }); // the user wants to search by resource type this.view.addResourceCriteriaButtonClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { view.setAvailableTypes(fetchResourceTypes()); } }); // the user wants to search by resource type this.view.addAvailableTypesBoxChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent event) { if (view.isResourceCriteriaEnabled()) { if (view.getSelectedType() != null && !"".equals(view.getSelectedResource())) { fetchResourcesByType(view.getSelectedType()); } } if (view.isPolicyCriteriaEnabled()) { if (view.getSelectedType() != null && "RL".equals(view.getSelectedType())) { view.setRLEffectBoxVisible(true); view.setRLEffectLabelVisible(true); } else { view.setRLEffectBoxVisible(false); view.setRLEffectLabelVisible(false); } } } }); // the user wants to search by rs name this.view.addResourceNameBoxChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent event) { if (view.getSelectedType() != null && !"".equals(view.getSelectedResource())) { getOperationNamesByRs(view.getSelectedResource()); PolicySummaryPresenter.this.view.setOperationNames(); } } }); // the user wants to search by SubjectGroup type and name this.view.addSubjectGroupCriteriaButtonClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { view.setAvailableTypes(fetchSubjectTypes()); } }); this.view.addSearchButtonClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (PolicySummaryPresenter.this.view.isPolicyCriteriaEnabled()) { fetchPolicyTypes(); fetchPoliciesByName(PolicySummaryPresenter.this.view.getSearchTerm(), PolicySummaryPresenter.this.view.getSelectedType(), PolicySummaryPresenter.this.view.getSelectedEffect()); } else if (PolicySummaryPresenter.this.view.isResourceCriteriaEnabled()) { fetchPoliciesByResource(PolicySummaryPresenter.this.view.getSelectedType(), PolicySummaryPresenter.this.view.getSelectedResource(), PolicySummaryPresenter.this.view.getSelectedOperation()); } else if (PolicySummaryPresenter.this.view.isSubjectCriteriaEnabled()) { fetchPoliciesBySubject(PolicySummaryPresenter.this.view.getSearchTerm(), PolicySummaryPresenter.this.view.getSelectedType()); } else if (PolicySummaryPresenter.this.view.isSubjectGroupCriteriaEnabled()) { fetchPoliciesBySubjectGroupName(PolicySummaryPresenter.this.view.getSearchTerm(), PolicySummaryPresenter.this.view.getSelectedType()); } else { PolicySummaryPresenter.this.view .error(PolicyAdminUIUtil.policyAdminConstants.searchCriteriaInvalid()); } // fetchPolicies(view.isSearchCriteriaEnabled(), // view.getSelectedType(), view.getSearchTerm()); // setPolicies(); } }); this.view.addActionButtonAboveClickHandler(new ClickHandler() { /* * (non-Javadoc) * * @see * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google * .gwt.event.dom.client.ClickEvent) */ public void onClick(ClickEvent event) { Map<GenericPolicy, UserAction> pending = view.getPendingActions(); if (pending.isEmpty()) { return; } // Things that can be pending: // 1. editing/viewing a SINGLE policy // or // 2. deleting multiple policies // or // 3. enabling/disabling multiple policies // 4. export. must be in bulk if (!pending.isEmpty()) { UserAction action = null; // all action should be same for (Map.Entry<GenericPolicy, UserAction> entry : pending.entrySet()) { action = entry.getValue(); break; } if (action == null) { return; } else { switch (action) { case POLICY_VIEW: { GWT.log("VIEW POLICY:"); for (Map.Entry<GenericPolicy, UserAction> entry : pending.entrySet()) { HistoryToken token = makeToken(PolicyController.PRESENTER_ID, PolicyViewPresenter.PRESENTER_ID, null); token.addValue(HistoryToken.SELECTED_POLICY_TOKEN_ID, String.valueOf(entry.getKey().getId())); token.addValue(HistoryToken.SELECTED_POLICY_TOKEN_TYPE, String.valueOf(entry.getKey().getType())); History.newItem(token.toString(), true); } break; } case POLICY_EDIT: { GWT.log("EDIT POLICY:"); for (Map.Entry<GenericPolicy, UserAction> entry : pending.entrySet()) { String policyType = String.valueOf(entry.getKey().getType()); String subPresenter = null; if ("BLACKLIST".equals(policyType)) { subPresenter = BLPolicyEditPresenter.PRESENTER_ID; } else if ("WHITELIST".equals(policyType)) { subPresenter = WLPolicyEditPresenter.PRESENTER_ID; } else if ("AUTHZ".equals(policyType)) { subPresenter = AUTHZPolicyEditPresenter.PRESENTER_ID; } else if ("RL".equals(policyType)) { subPresenter = RLPolicyEditPresenter.PRESENTER_ID; } HistoryToken token = makeToken(PolicyController.PRESENTER_ID, subPresenter, null); token.addValue(HistoryToken.SELECTED_POLICY_TOKEN_ID, String.valueOf(entry.getKey().getId())); token.addValue(HistoryToken.SELECTED_POLICY_TOKEN_TYPE, String.valueOf(entry.getKey().getType())); if ((entry.getKey().getEnabled() && permissions.get(entry.getKey()).contains(UserAction.POLICY_DISABLE) || (!entry.getKey().getEnabled() && permissions.get(entry.getKey()) .contains(UserAction.POLICY_ENABLE)))) { token.addValue(HistoryToken.POLICY_STATUS_EDITABLE, "true"); } else { token.addValue(HistoryToken.POLICY_STATUS_EDITABLE, "false"); } History.newItem(token.toString(), true); } break; } case POLICY_ENABLE: { for (Map.Entry<GenericPolicy, UserAction> entry : pending.entrySet()) { final GenericPolicy p = entry.getKey(); final PolicyKey key = new PolicyKey(); key.setId(entry.getKey().getId()); key.setName(entry.getKey().getName()); key.setType(entry.getKey().getType()); GWT.log("Updating status for :" + entry.getKey().getType() + " - " + entry.getKey().getName()); service.enablePolicy(key, new AsyncCallback<EnablePolicyResponse>() { public void onFailure(Throwable arg) { if (arg.getLocalizedMessage().contains("500")) { view.error(PolicyAdminUIUtil.messages.serverError( PolicyAdminUIUtil.policyAdminConstants.genericErrorMessage())); } else { view.error(PolicyAdminUIUtil.messages .serverError(arg.getLocalizedMessage())); } GWT.log("ERROR - Enabling fails"); } public void onSuccess(EnablePolicyResponse result) { ((GenericPolicyImpl) p).setEnabled(true); view.setPolicies(policies); } }); } break; } case POLICY_DISABLE: { for (Map.Entry<GenericPolicy, UserAction> entry : pending.entrySet()) { final GenericPolicy p = entry.getKey(); final PolicyKey key = new PolicyKey(); key.setId(entry.getKey().getId()); key.setName(entry.getKey().getName()); key.setType(entry.getKey().getType()); GWT.log("Updating status for :" + entry.getKey().getType() + " - " + entry.getKey().getName()); service.disablePolicy(key, new AsyncCallback<DisablePolicyResponse>() { public void onFailure(Throwable arg) { if (arg.getLocalizedMessage().contains("500")) { view.error(PolicyAdminUIUtil.messages.serverError( PolicyAdminUIUtil.policyAdminConstants.genericErrorMessage())); } else { view.error(PolicyAdminUIUtil.messages .serverError(arg.getLocalizedMessage())); } } public void onSuccess(DisablePolicyResponse result) { ((GenericPolicyImpl) p).setEnabled(false); view.setPolicies(policies); } }); } break; } case POLICY_DELETE: { if (Window.confirm(PolicyAdminUIUtil.policyAdminConstants.deleteSelected())) { for (Map.Entry<GenericPolicy, UserAction> entry : pending.entrySet()) { final PolicyKey key = new PolicyKey(); key.setType(entry.getKey().getType()); key.setName(entry.getKey().getName()); key.setId(entry.getKey().getId()); service.deletePolicy(key, new AsyncCallback<DeletePolicyResponse>() { public void onSuccess(DeletePolicyResponse result) { ((Button) view.getSearchButton()).click(); } public void onFailure(Throwable arg) { if (arg.getLocalizedMessage().contains("500")) { view.error(PolicyAdminUIUtil.messages .serverError(PolicyAdminUIUtil.policyAdminConstants .genericErrorMessage())); } else { view.error(PolicyAdminUIUtil.messages .serverError(arg.getLocalizedMessage())); } } }); } } break; } case POLICY_EXPORT: { GWT.log("EXPORT POLICY:"); StringBuffer downloadUrl = new StringBuffer(); downloadUrl.append("/xprtPlc/policy?"); int i = 0; for (Map.Entry<GenericPolicy, UserAction> entry : pending.entrySet()) { downloadUrl.append(entry.getKey().getId() + "&"); i++; if (i == pending.entrySet().size()) { // all entries are same type downloadUrl.append(entry.getKey().getType() + "&"); // user & pass AppUser user = AppUser.getUser(); downloadUrl.append(user.getUsername() + "&"); downloadUrl.append(user.getPassword()); } } Window.open(downloadUrl.toString(), "_blank", ""); break; } } } } } }); }
From source file:org.ebayopensource.turmeric.policy.adminui.client.presenter.policy.SubjectGroupSummaryPresenter.java
License:Open Source License
/** * Bind.//from w ww. j a va2 s.c om */ public void bind() { // The user wants to search by subject group type + name this.view.getSubjectCriteriaButton().addClickHandler(new ClickHandler() { public void onClick(final ClickEvent event) { view.setAvailableTypes(fetchSubjectTypes()); view.setSelectedSearchTerm(""); } }); // the user wants to search by policy type and name this.view.getPolicyCriteriaButton().addClickHandler(new ClickHandler() { public void onClick(final ClickEvent event) { view.setAvailableTypes(fetchPolicyTypes()); view.setSelectedSearchTerm(""); } }); this.view.getSearchButton().addClickHandler(new ClickHandler() { public void onClick(final ClickEvent event) { fetchGroups(view.isSubjectCriteriaEnabled(), view.getSelectedType(), view.getSearchTerm()); } }); this.view.getActionButton().addClickHandler(new ClickHandler() { public void onClick(final ClickEvent event) { Map<SubjectGroup, UserAction> pending = view.getPendingActions(); if (pending == null) { return; } if (pending.size() == 0) { return; } // all user actions have to be the same, so pick the first one SubjectGroup group = pending.keySet().iterator().next(); UserAction action = pending.get(group); HistoryToken token; switch (action) { case SUBJECT_GROUP_VIEW: token = makeToken(PolicyController.PRESENTER_ID, SubjectGroupViewPresenter.PRESENTER_ID, null); token.addValue(HistoryToken.SELECTED_SUBJECT_GROUP_TOKEN, group.getName()); token.addValue(HistoryToken.SELECTED_SUBJECT_GROUP_TYPE_TOKEN, group.getType().toString()); History.newItem(token.toString(), true); break; case SUBJECT_GROUP_EDIT: token = makeToken(PolicyController.PRESENTER_ID, SubjectGroupEditPresenter.PRESENTER_ID, null); token.addValue(HistoryToken.SELECTED_SUBJECT_GROUP_TOKEN, group.getName()); token.addValue(HistoryToken.SELECTED_SUBJECT_GROUP_TYPE_TOKEN, group.getType().toString()); History.newItem(token.toString(), true); break; case SUBJECT_GROUP_DELETE: if (Window.confirm(PolicyAdminUIUtil.policyAdminConstants.deleteSelected())) { final List<SubjectGroupKey> keys = new ArrayList<SubjectGroupKey>(); Iterator<SubjectGroup> itor = pending.keySet().iterator(); SubjectGroup groupError = null; while (itor.hasNext() && groupError == null) { SubjectGroup sg = itor.next(); if (sg.getPolicies() != null && sg.getPolicies().size() > 0) { groupError = sg; } else { SubjectGroupKey key = new SubjectGroupKey(); key.setType(sg.getType()); key.setName(sg.getName()); key.setId(sg.getId()); keys.add(key); } } if (groupError != null) { view.error(PolicyAdminUIUtil.policyAdminConstants.deleteSubjetGroupInvalid()); } else { service.deleteSubjectGroups(keys, new AsyncCallback<DeleteSubjectGroupResponse>() { public void onSuccess(final DeleteSubjectGroupResponse result) { // fetchGroups(view.isSearchCriteriaEnabled(), // view.getSelectedType(), // view.getSearchTerm()); removeGroups(groups, keys); view.setGroups(groups); } public void onFailure(final Throwable arg) { if (arg.getLocalizedMessage().contains("500")) { view.error(PolicyAdminUIUtil.messages.serverError( PolicyAdminUIUtil.policyAdminConstants.genericErrorMessage())); } else { view.error( PolicyAdminUIUtil.messages.serverError(arg.getLocalizedMessage())); } } }); } } break; case SUBJECT_GROUP_EXPORT: GWT.log("EXPORT SG:"); StringBuffer downloadUrl = new StringBuffer(); downloadUrl.append("/xprtPlc/sg?"); int i = 0; for (Entry<SubjectGroup, UserAction> entry : pending.entrySet()) { downloadUrl.append(entry.getKey().getId() + "&"); i++; if (i == pending.entrySet().size()) { // all entries are same type downloadUrl.append(entry.getKey().getType() + "&"); // user & pass AppUser user = AppUser.getUser(); downloadUrl.append(user.getUsername() + "&"); downloadUrl.append(user.getPassword()); } } Window.open(downloadUrl.toString(), "_blank", ""); break; default: break; } } }); }
From source file:org.ebayopensource.turmeric.policy.adminui.client.view.SummaryPanel.java
License:Open Source License
/** * Instantiates a new summary panel./*ww w . j a v a 2s .c om*/ */ public SummaryPanel() { panel = new FlowPanel(); panel.addStyleName("summary-panel-item"); Grid headingGrid = new Grid(1, 2); headingLabel = new Label(""); headingGrid.setWidget(0, 0, headingLabel); headingGrid.setWidth("100%"); Grid buttonGrid = new Grid(1, 2); headingGrid.setWidget(0, 1, buttonGrid); headingGrid.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_RIGHT); infoImg = new Image(); infoImg.setUrl("images/info.png"); infoImgLight = new Image(); infoImgLight.setUrl("images/info-light.png"); PushButton ib = new PushButton(infoImg, infoImgLight); ib.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if (info != null) { InfoDialog dialog = new InfoDialog(false); dialog.setMessage(info); int x = infoImg.getAbsoluteLeft(); int y = infoImg.getAbsoluteTop() + infoImg.getOffsetHeight(); dialog.getDialog().setAutoHideEnabled(true); dialog.getDialog().setPopupPosition(x, y); dialog.getDialog().show(); } } }); downloadImg = new Image(); downloadImg.setUrl("images/dwnld.png"); downloadImg.addStyleName("dwnld"); downloadImgLight = new Image(); downloadImgLight.setUrl("images/dwnld-light.png"); PushButton db = new PushButton(downloadImg, downloadImgLight); db.addClickHandler(new ClickHandler() { public void onClick(ClickEvent arg0) { final Element downloadIframe = RootPanel.get("__download").getElement(); if (downloadIframe == null) Window.open(downloadUrl, "_blank", ""); else DOM.setElementAttribute(downloadIframe, "src", downloadUrl); } }); buttonGrid.setWidget(0, 0, ib); buttonGrid.setWidget(0, 1, db); panel.add(headingGrid); panel.setWidth("50em"); scroller = new ScrollPanel(); scroller.addStyleName("summary-scroll"); panel.add(scroller); initWidget(panel); }
From source file:org.eclipse.che.ide.actions.RedirectToDashboardProjectsAction.java
License:Open Source License
/** {@inheritDoc} */ @Override//from w w w . j a va 2 s. c om public void actionPerformed(ActionEvent e) { Window.open(REDIRECT_URL, "_blank", ""); }