List of usage examples for com.google.gwt.user.client.ui Label addClickHandler
public HandlerRegistration addClickHandler(ClickHandler handler)
From source file:org.bonitasoft.console.client.view.cases.CaseHistoryWidget.java
License:Open Source License
protected FlowPanel buildSummaryPanel(final StepItem anItem) { final String theExecutionSummary; if (anItem.getExecutionSummary() != null && anItem.getExecutionSummary().length() > 0) { theExecutionSummary = anItem.getExecutionSummary(); } else {//from www .j a va 2s. c o m switch (anItem.getState()) { case ABORTED: theExecutionSummary = patterns.stepExecutionSummaryAborted(anItem.getLabel()); break; case CANCELLED: theExecutionSummary = patterns.stepExecutionSummaryCancelled(anItem.getLabel()); break; case SKIPPED: theExecutionSummary = patterns.stepExecutionSummarySkipped(anItem.getLabel()); break; default: theExecutionSummary = patterns.stepExecutionSummaryFinished(anItem.getLabel()); break; } } final FlowPanel theSummaryWrapper = new FlowPanel(); final Label theSummary = new Label(theExecutionSummary); theSummaryWrapper.add(theSummary); if (UserRightsManager.getInstance().isAllowed(RuleType.ACTIVITY_DETAILS_READ, anItem.getUUID().getStepDefinitionUUID())) { theSummary.setStylePrimaryName(CSSClassManager.POPUP_MENU_ENTRY); theSummary.addClickHandler(new ClickHandler() { private boolean formIsVisible = false; private StepEditor myStepEditor; public void onClick(ClickEvent aEvent) { toggleSummaryView(); } private void toggleSummaryView() { if (formIsVisible) { if (myStepEditor != null) { theSummaryWrapper.remove(myStepEditor); if (DOMUtils.getInstance().isInternetExplorer()) { myStepEditor = null; } formIsVisible = false; } } else { if (myStepEditor == null) { myStepEditor = new StepEditor(myStepItemDataSource, anItem, true, myCaseDataSource, myProcessDataSource, (UserDataSource) null); theSummaryWrapper.add(myStepEditor); } else { theSummaryWrapper.add(myStepEditor); } formIsVisible = true; } } }); } return theSummaryWrapper; }
From source file:org.bonitasoft.console.client.view.categories.CategoriesListWidget.java
License:Open Source License
@Override protected FlowPanel buildTopNavBar() { final FlowPanel theFirstCell = new FlowPanel(); final CustomMenuBar theTopMenu = new CustomMenuBar(); theTopMenu.addItem(constants.add(), new Command() { public void execute() { addItem();/*from www. ja v a 2 s . c o m*/ } }); theTopMenu.addItem(constants.delete(), new Command() { public void execute() { //add a ConfirmationDialogbox when you delete a Categorie. if (myItemSelection.getSize() > 0) { confirmationDialogbox = new ConfirmationDialogbox(constants.deleteCategoriesDialogbox(), patterns.deleteCategoriesWarn(myItemSelection.getSelectedItems().size()), constants.okButton(), constants.cancelButton()); confirmationDialogbox.addCloseHandler(new CloseHandler<PopupPanel>() { public void onClose(CloseEvent<PopupPanel> event) { if (confirmationDialogbox.getConfirmation()) { deleteSelectedItems(); } } }); } else { if (myMessageDataSource != null) { myMessageDataSource.addWarningMessage(messages.noCategorySelected()); } } } }); Label theRefreshLink = new Label(constants.refresh()); theRefreshLink.setStylePrimaryName(CSSClassManager.LINK_LABEL); theRefreshLink.addClickHandler(new ClickHandler() { public void onClick(ClickEvent aEvent) { myBonitaDataSource.reload(); } }); theFirstCell.add(new SimpleSelectorWidget<CategoryUUID, Category, SimpleFilter>(myBonitaDataSource)); theFirstCell.add(theTopMenu); theFirstCell.add(theRefreshLink); return theFirstCell; }
From source file:org.bonitasoft.console.client.view.categories.CategoryFinderPanel.java
License:Open Source License
private FlexTable buildContent() { FlexTable thePanel = new FlexTable(); thePanel.setWidget(0, 0, myErrorMessageLabel); thePanel.getFlexCellFormatter().setStyleName(0, 0, CSSClassManager.VALIDATION_ERROR_MESSAGE); thePanel.getFlexCellFormatter().setColSpan(0, 0, 3); myInternalItemDataSource.setItemFilter(myItemFilter); CategoriesListWidget myItemList = new CategoriesListWidget(null, myInternalItemDataSource) { @Override/* w ww . j av a 2s.c om*/ protected void initView() { myMinimalSize = 10; myMaximalSize = 50; super.initView(); if (myBottomNavBar.getWidgetCount() == 2) { myBottomNavBar.remove(1); } } @Override public void notifyItemClicked(CategoryUUID anItem, ClickEvent anEvent) { // Modify item selection. if (anItem != null) { final Cell theCell = myInnerTable.getCellForEvent(anEvent); if (theCell != null) { final int theCellIndex = theCell.getCellIndex(); if (theCellIndex != 0) { if (mySelectionIsMultiple) { if (myItemSelection.getSelectedItems().contains(anItem)) { myItemSelection.removeItemFromSelection(anItem); } else { myItemSelection.addItemToSelection(anItem); } } else { if (!myItemSelection.getSelectedItems().contains(anItem)) { myItemSelection.clearSelection(); myItemSelection.addItemToSelection(anItem); } else { myItemSelection.clearSelection(); } } } else { // The check box has already inserted the item into the selection. if (mySelectionIsMultiple) { // Nothing to do here. } else { if (myItemSelection.getSize() > 1) { // I have to solve the inconsistency here. myItemSelection.clearSelection(); myItemSelection.addItemToSelection(anItem); } } } } } } @Override protected FlowPanel buildTopNavBar() { final FlowPanel theResult = new FlowPanel(); final Label theRefreshLink = new Label(constants.refresh()); theRefreshLink.setStyleName(CSSClassManager.LINK_LABEL); theRefreshLink.addClickHandler(new ClickHandler() { public void onClick(ClickEvent aEvent) { myBonitaDataSource.reload(); } }); theResult.add(theRefreshLink); return theResult; } @Override protected FlowPanel buildBottomNavBar() { final FlowPanel theResult = new FlowPanel(); final CustomMenuBar theActionMenu = new CustomMenuBar(); theActionMenu.addItem(constants.add(), new Command() { public void execute() { setSelectedItems(myItemSelection); } }); theActionMenu.addItem(constants.cancel(), new Command() { public void execute() { cancel(); } }); theResult.add(theActionMenu); return theResult; } }; thePanel.setWidget(2, 0, myItemList); thePanel.getFlexCellFormatter().setColSpan(2, 0, 3); return thePanel; }
From source file:org.bonitasoft.console.client.view.CSSStyleSelectorWidget.java
License:Open Source License
/** * // ww w. j a v a2s. c o m * Default constructor. * * @param aLabelDataSource * @param aLabelModel */ public CSSStyleSelectorWidget() { super(); FlexTable theOuterPanel = new FlexTable(); Label theLabel; DecoratorPanel theContainer; theLabel = new Label(TITLE_LABEL_KEY); theOuterPanel.setWidget(0, 0, theLabel); theOuterPanel.getFlexCellFormatter().setColSpan(0, 0, 4); if (editableCSSClassName.length != readonlyCSSClassName.length || editableCSSClassName.length != previewCSSClassName.length) { Window.alert("Invalid list of CSS style definitions in class LabelStyleSelectorWidget!"); } int theRow = 1; int theCol = 0; for (int i = 0; i < editableCSSClassName.length; i++) { theContainer = new DecoratorPanel(); theLabel = new Label(B_CHARACTER); theContainer.add(theLabel); theContainer.setStylePrimaryName(previewCSSClassName[i] + CONTAINER_CSS_SUFFIX); theLabel.setStyleName(previewCSSClassName[i]); theLabel.addClickHandler(new StyleClickHandler(editableCSSClassName[i], previewCSSClassName[i], readonlyCSSClassName[i])); theOuterPanel.setWidget(theRow, theCol, theContainer); // Go to a new line every 4 choices. if (theCol == 3) { theRow++; theCol = 0; } else { theCol++; } } this.add(theOuterPanel); // Set the auto hide feature. setAutoHideEnabled(true); }
From source file:org.bonitasoft.console.client.view.identity.GroupFinderPanel.java
License:Open Source License
private FlexTable buildContent() { FlexTable thePanel = new FlexTable(); thePanel.setWidget(0, 0, myErrorMessageLabel); thePanel.getFlexCellFormatter().setStyleName(0, 0, CSSClassManager.VALIDATION_ERROR_MESSAGE); thePanel.getFlexCellFormatter().setColSpan(0, 0, 3); myInternalItemDataSource.setItemFilter(myItemFilter); GroupsListWidget myUserList = new GroupsListWidget(null, myInternalItemDataSource) { @Override/*from www . j ava2 s. c om*/ protected void initView() { myMinimalSize = 10; myMaximalSize = 10; super.initView(); if (myBottomNavBar.getWidgetCount() == 2) { myBottomNavBar.remove(1); } } /* * (non-Javadoc) * * @seeorg.bonitasoft.console.client.view.identity.UsersListWidget# * getContentRowTooltip() */ @Override protected String getContentRowTooltip() { return ""; } @Override public void notifyItemClicked(BonitaUUID anItem, ClickEvent anEvent) { // Modify item selection. if (anItem != null) { final Cell theCell = myInnerTable.getCellForEvent(anEvent); if (theCell != null) { final int theCellIndex = theCell.getCellIndex(); if (theCellIndex != 0) { if (mySelectionIsMultiple) { if (myItemSelection.getSelectedItems().contains(anItem)) { myItemSelection.removeItemFromSelection(anItem); } else { myItemSelection.addItemToSelection(anItem); } } else { if (!myItemSelection.getSelectedItems().contains(anItem)) { myItemSelection.clearSelection(); myItemSelection.addItemToSelection(anItem); } else { myItemSelection.clearSelection(); } } } else { // The check box has already inserted the item into the selection. if (mySelectionIsMultiple) { // Nothing to do here. } else { if (myItemSelection.getSize() > 1) { // I have to solve the inconsistency here. myItemSelection.clearSelection(); myItemSelection.addItemToSelection(anItem); } } } } } } @Override protected FlowPanel buildTopNavBar() { final FlowPanel theResult = new FlowPanel(); final Label theRefreshLink = new Label(constants.refresh()); theRefreshLink.setStyleName(CSSClassManager.LINK_LABEL); theRefreshLink.addClickHandler(new ClickHandler() { public void onClick(ClickEvent aEvent) { myBonitaDataSource.reload(); } }); theResult.add(theRefreshLink); return theResult; } @Override protected FlowPanel buildBottomNavBar() { final FlowPanel theResult = new FlowPanel(); final CustomMenuBar theActionMenu = new CustomMenuBar(); theActionMenu.addItem(constants.add(), new Command() { public void execute() { setSelectedItems(myItemSelection); } }); theActionMenu.addItem(constants.cancel(), new Command() { public void execute() { cancel(); } }); theResult.add(theActionMenu); return theResult; } }; thePanel.setWidget(2, 0, myUserList); thePanel.getFlexCellFormatter().setColSpan(2, 0, 3); return thePanel; }
From source file:org.bonitasoft.console.client.view.identity.GroupsListWidget.java
License:Open Source License
@Override protected FlowPanel buildTopNavBar() { final FlowPanel theFirstCell = new FlowPanel(); final CustomMenuBar theTopMenu = new CustomMenuBar(); theTopMenu.addItem(constants.add(), new Command() { public void execute() { addItem();//from w ww .ja v a2s .com } }); theTopMenu.addItem(constants.delete(), new Command() { public void execute() { //add a ConfirmationDialogbox when you delete Group. if (myItemSelection.getSize() > 0) { confirmationDialogbox = new ConfirmationDialogbox(constants.deleteGroupsDialogbox(), patterns.deleteGroupsWarn(myItemSelection.getSelectedItems().size()), constants.okButton(), constants.cancelButton()); confirmationDialogbox.addCloseHandler(new CloseHandler<PopupPanel>() { public void onClose(CloseEvent<PopupPanel> event) { if (confirmationDialogbox.getConfirmation()) { deleteSelectedItems(); } } }); } else { if (myMessageDataSource != null) { myMessageDataSource.addWarningMessage(messages.noGroupSelected()); } } } }); Label theRefreshLink = new Label(constants.refresh()); theRefreshLink.setStylePrimaryName(CSSClassManager.LINK_LABEL); theRefreshLink.addClickHandler(new ClickHandler() { public void onClick(ClickEvent aEvent) { myBonitaDataSource.reload(); } }); // Create the Selector Widget theFirstCell.add(new GroupSelectorWidget((GroupDataSource) myBonitaDataSource)); theFirstCell.add(theTopMenu); theFirstCell.add(theRefreshLink); return theFirstCell; }
From source file:org.bonitasoft.console.client.view.identity.MembershipsListEditorView.java
License:Open Source License
protected void buildContent() { myAddErrorValidationMessage = new Label(); myMembershipsList = new Grid(1, 3); myMembershipsList.setWidth("100%"); myMembershipsList.setStylePrimaryName("item_list"); myMembershipsList.setWidget(0, 0, buildSelectAllSelector()); myMembershipsList.setHTML(0, 1, constants.groupPath()); myMembershipsList.setHTML(0, 2, constants.membershipRoleName()); myMembershipsList.getColumnFormatter().setStyleName(0, "item_selector"); myMembershipsList.getColumnFormatter().setStyleName(1, "group_path"); myMembershipsList.getColumnFormatter().setStyleName(2, "role_name"); myMembershipsList.getRowFormatter().setStylePrimaryName(0, "item_list_content_row_title"); final FlowPanel theAddGroupPanel = new FlowPanel(); theAddGroupPanel.setStylePrimaryName(CSSClassManager.GROUP_PANEL); theAddGroupPanel.setVisible(false);/*from w w w .j a v a 2 s . co m*/ final Label theAddGroupPanelCaption = new Label(constants.addMembershipGroupPanelCaption()); theAddGroupPanelCaption.setStylePrimaryName(CSSClassManager.GROUP_PANEL_CAPTION); final Label theAddGroupPanelCloseCaption = new Label(); theAddGroupPanelCloseCaption.setTitle(constants.close()); theAddGroupPanelCloseCaption.setStylePrimaryName(CSSClassManager.GROUP_PANEL_ACTION_CAPTION); theAddGroupPanelCloseCaption.addClickHandler(new ClickHandler() { public void onClick(ClickEvent aEvent) { myGroupViewerPanel.setItem(null); myRoleViewerPanel.setItem(null); theAddGroupPanel.setVisible(false); } }); final Grid theAddPanel = new Grid(2, 2); theAddPanel.setStylePrimaryName(CSSClassManager.GROUP_PANEL_CONTENT); theAddPanel.setWidget(0, 0, new Label(constants.chooseAGroup())); theAddPanel.setWidget(0, 1, myGroupViewerPanel); theAddPanel.setWidget(1, 0, new Label(constants.chooseARole())); theAddPanel.setWidget(1, 1, myRoleViewerPanel); final CustomMenuBar theAddButton = new CustomMenuBar(); theAddButton.addItem(constants.add(), new Command() { public void execute() { addMembershipToList(); theAddGroupPanel.setVisible(false); myGroupViewerPanel.setItem(null); myRoleViewerPanel.setItem(null); } }); theAddGroupPanel.add(theAddGroupPanelCloseCaption); theAddGroupPanel.add(theAddGroupPanelCaption); theAddGroupPanel.add(myAddErrorValidationMessage); theAddGroupPanel.add(theAddPanel); theAddGroupPanel.add(theAddButton); final CustomMenuBar theActionButtons = new CustomMenuBar(); theActionButtons.addItem(constants.add(), new Command() { public void execute() { theAddGroupPanel.setVisible(true); } }); theActionButtons.addItem(constants.delete(), new Command() { public void execute() { removeSelectedItems(); } }); myOuterPanel.setWidget(0, 0, myMembershipsList); myOuterPanel.setWidget(1, 0, theActionButtons); myOuterPanel.setWidget(2, 0, theAddGroupPanel); myMembershipsErrorMessage = new Label(); myMembershipsErrorMessage.setStyleName(CSSClassManager.VALIDATION_ERROR_MESSAGE); myOuterPanel.setWidget(3, 0, myMembershipsErrorMessage); }
From source file:org.bonitasoft.console.client.view.identity.RoleFinderPanel.java
License:Open Source License
private FlexTable buildContent() { FlexTable thePanel = new FlexTable(); thePanel.setWidget(0, 0, myErrorMessageLabel); thePanel.getFlexCellFormatter().setStyleName(0, 0, CSSClassManager.VALIDATION_ERROR_MESSAGE); thePanel.getFlexCellFormatter().setColSpan(0, 0, 3); myInternalItemDataSource.setItemFilter(myItemFilter); RolesListWidget myUserList = new RolesListWidget(null, myInternalItemDataSource) { @Override// w ww. j a v a 2 s .c o m protected void initView() { myMinimalSize = 10; myMaximalSize = 10; super.initView(); if (myBottomNavBar.getWidgetCount() == 2) { myBottomNavBar.remove(1); } } /* * (non-Javadoc) * * @seeorg.bonitasoft.console.client.view.identity.UsersListWidget# * getContentRowTooltip() */ @Override protected String getContentRowTooltip() { return ""; } @Override public void notifyItemClicked(BonitaUUID anItem, ClickEvent anEvent) { // Modify item selection. if (anItem != null) { final Cell theCell = myInnerTable.getCellForEvent(anEvent); if (theCell != null) { final int theCellIndex = theCell.getCellIndex(); if (theCellIndex != 0) { if (mySelectionIsMultiple) { if (myItemSelection.getSelectedItems().contains(anItem)) { myItemSelection.removeItemFromSelection(anItem); } else { myItemSelection.addItemToSelection(anItem); } } else { if (!myItemSelection.getSelectedItems().contains(anItem)) { myItemSelection.clearSelection(); myItemSelection.addItemToSelection(anItem); } else { myItemSelection.clearSelection(); } } } else { // The check box has already inserted the item into the selection. if (mySelectionIsMultiple) { // Nothing to do here. } else { if (myItemSelection.getSize() > 1) { // I have to solve the inconsistency here. myItemSelection.clearSelection(); myItemSelection.addItemToSelection(anItem); } } } } } } @Override protected FlowPanel buildTopNavBar() { final FlowPanel theResult = new FlowPanel(); final Label theRefreshLink = new Label(constants.refresh()); theRefreshLink.setStyleName(CSSClassManager.LINK_LABEL); theRefreshLink.addClickHandler(new ClickHandler() { public void onClick(ClickEvent aEvent) { myBonitaDataSource.reload(); } }); theResult.add(theRefreshLink); return theResult; } @Override protected FlowPanel buildBottomNavBar() { final FlowPanel theResult = new FlowPanel(); final CustomMenuBar theActionMenu = new CustomMenuBar(); theActionMenu.addItem(constants.add(), new Command() { public void execute() { setSelectedItems(myItemSelection); } }); theActionMenu.addItem(constants.cancel(), new Command() { public void execute() { cancel(); } }); theResult.add(theActionMenu); return theResult; } }; thePanel.setWidget(2, 0, myUserList); thePanel.getFlexCellFormatter().setColSpan(2, 0, 3); return thePanel; }
From source file:org.bonitasoft.console.client.view.identity.RolesListWidget.java
License:Open Source License
@Override protected FlowPanel buildTopNavBar() { final FlowPanel theFirstCell = new FlowPanel(); final CustomMenuBar theTopMenu = new CustomMenuBar(); theTopMenu.addItem(constants.add(), new Command() { public void execute() { addItem();// w w w.ja va2 s .c om } }); theTopMenu.addItem(constants.delete(), new Command() { public void execute() { //add a ConfirmationDialogbox when you delete Roles. if (myItemSelection.getSize() > 0) { confirmationDialogbox = new ConfirmationDialogbox(constants.deleteRolesDialogbox(), patterns.deleteRolesWarn(myItemSelection.getSelectedItems().size()), constants.okButton(), constants.cancelButton()); confirmationDialogbox.addCloseHandler(new CloseHandler<PopupPanel>() { public void onClose(CloseEvent<PopupPanel> event) { if (confirmationDialogbox.getConfirmation()) { deleteSelectedItems(); } } }); } else { if (myMessageDataSource != null) { myMessageDataSource.addWarningMessage(messages.noRoleSelected()); } } } }); Label theRefreshLink = new Label(constants.refresh()); theRefreshLink.setStylePrimaryName(CSSClassManager.LINK_LABEL); theRefreshLink.addClickHandler(new ClickHandler() { public void onClick(ClickEvent aEvent) { myBonitaDataSource.reload(); } }); theFirstCell.add(new RoleSelectorWidget((RoleDataSource) myBonitaDataSource)); theFirstCell.add(theTopMenu); theFirstCell.add(theRefreshLink); return theFirstCell; }
From source file:org.bonitasoft.console.client.view.identity.UserFinderPanel.java
License:Open Source License
private FlexTable buildContent() { FlexTable thePanel = new FlexTable(); thePanel.setWidget(0, 0, myErrorMessageLabel); thePanel.getFlexCellFormatter().setStyleName(0, 0, CSSClassManager.VALIDATION_ERROR_MESSAGE); thePanel.getFlexCellFormatter().setColSpan(0, 0, 3); myInternalItemDataSource.setItemFilter(myUserFilter); UsersListWidget myUserList = new UsersListWidget(null, myInternalItemDataSource, null, null, null) { @Override/* www . j av a2 s .co m*/ protected void initView() { myMinimalSize = 10; myMaximalSize = 10; super.initView(); if (myBottomNavBar.getWidgetCount() == 2) { myBottomNavBar.remove(1); } } /* * (non-Javadoc) * * @seeorg.bonitasoft.console.client.view.identity.UsersListWidget# * getContentRowTooltip() */ @Override protected String getContentRowTooltip() { return ""; } @Override public void notifyItemClicked(UserUUID anItem, ClickEvent anEvent) { // Modify item selection. if (anItem != null) { final Cell theCell = myInnerTable.getCellForEvent(anEvent); if (theCell != null) { final int theCellIndex = theCell.getCellIndex(); if (theCellIndex != 0) { if (mySelectionIsMultiple) { if (myItemSelection.getSelectedItems().contains(anItem)) { myItemSelection.removeItemFromSelection(anItem); } else { myItemSelection.addItemToSelection(anItem); } } else { if (!myItemSelection.getSelectedItems().contains(anItem)) { myItemSelection.clearSelection(); myItemSelection.addItemToSelection(anItem); } else { myItemSelection.clearSelection(); } } } else { // The check box has already inserted the item into the selection. if (mySelectionIsMultiple) { // Nothing to do here. } else { if (myItemSelection.getSize() > 1) { // I have to solve the inconsistency here. myItemSelection.clearSelection(); myItemSelection.addItemToSelection(anItem); } } } } } } @Override protected FlowPanel buildTopNavBar() { final FlowPanel theResult = new FlowPanel(); final Label theRefreshLink = new Label(constants.refresh()); theRefreshLink.setStyleName(CSSClassManager.LINK_LABEL); theRefreshLink.addClickHandler(new ClickHandler() { public void onClick(ClickEvent aEvent) { myBonitaDataSource.reload(); } }); theResult.add(theRefreshLink); return theResult; } @Override protected FlowPanel buildBottomNavBar() { final FlowPanel theResult = new FlowPanel(); final CustomMenuBar theActionMenu = new CustomMenuBar(); theActionMenu.addItem(constants.add(), new Command() { public void execute() { setSelectedUsers(myItemSelection); } }); theActionMenu.addItem(constants.cancel(), new Command() { public void execute() { cancel(); } }); theResult.add(theActionMenu); return theResult; } }; thePanel.setWidget(2, 0, myUserList); thePanel.getFlexCellFormatter().setColSpan(2, 0, 3); return thePanel; }