com.google.gwt.event.dom.client.ClickHandler Java Examples
The following examples show how to use
com.google.gwt.event.dom.client.ClickHandler.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExtendedFlexTable.java From document-management-system with GNU General Public License v2.0 | 6 votes |
/** * ExtendedFlexTable */ public ExtendedFlexTable() { super(); // Adds double click event control to table ( on default only has CLICK ) sinkEvents(Event.ONDBLCLICK); addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { // Mark selected row or orders rows if header row (0) is clicked // And row must be other than the selected one markSelectedRow(getCellForEvent(event).getRowIndex()); Main.get().onlineUsersPopup.enableAcceptButton(); } }); }
Example #2
Source File: BasePopupPanel.java From EasyML with Apache License 2.0 | 6 votes |
public void setCloseEnable(boolean enable) { if (!enable) { verticalPanel.remove(closeButton); } else { closeButton.setSize("10px", "10px"); closeButton.setStyleName("closebtn"); closeButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { BasePopupPanel.this.hide(); } }); verticalPanel.add(closeButton); verticalPanel.setCellHeight(closeButton, "13px"); } }
Example #3
Source File: LicenseDialog.java From circuitjs1 with GNU General Public License v2.0 | 6 votes |
LicenseDialog() { super(); vp = new VerticalPanel(); setWidget(vp); setText(sim.LS("License")); vp.setWidth("500px"); vp.add(new HTML("<iframe style=\"border:0;\" src=\"help/license.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>")); vp.add(okButton = new Button("OK")); okButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { closeDialog(); } }); center(); show(); }
Example #4
Source File: SaveDatasetPanel.java From EasyML with Apache License 2.0 | 6 votes |
@Override protected void init(){ grid = new DescribeGrid(labarr, "data"); verticalPanel.add(grid); grid.addStyleName("bda-descgrid-savedata"); savebtn.setStyleName("bda-descgrid-savedata-submitbtn"); SimplePanel simPanel = new SimplePanel(); simPanel.add( savebtn ); simPanel.setStyleName("bda-descgrid-savedata-simpanel"); verticalPanel.add(simPanel); savebtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { dbController.submitSaveDataset2DB(panel,SaveDatasetPanel.this, dataset,grid); } }); }
Example #5
Source File: SqlScriptFileConfigTable.java From EasyML with Apache License 2.0 | 6 votes |
public SqlScriptFileConfigTable(SqlProgramWidget widget, String name){ this.widget = widget; this.name = name; this.insertRow(0); Label add = new Label(); add.addStyleName("admin-user-edit"); this.setWidget(0, 0, new Label(name)); this.setWidget(0, 1, new Label()); this.setWidget(0, 2, add); this.setWidget(0, 3, new Label()); add.addClickHandler(new ClickHandler(){ @Override public void onClick(ClickEvent event) { int i = 0; while( i < SqlScriptFileConfigTable.this.getRowCount() && SqlScriptFileConfigTable.this.getWidget(i, 2 ) != event.getSource() ) i ++ ; if( i < SqlScriptFileConfigTable.this.getRowCount() ){ addRow( i, ""); } } }); }
Example #6
Source File: MailViewer.java From document-management-system with GNU General Public License v2.0 | 6 votes |
/** * getMailWidget */ private Button getMailWidget(final String mail, FlowPanel flowPanel) { final Button button = new Button(); final String mailTo = mail.contains("<") ? mail.substring(mail.indexOf("<") + 1, mail.indexOf(">")).trim() : mail.trim(); String mailHTML = mail.trim().replace("<", "<").replace(">", ">"); button.setHTML(mailHTML); button.setTitle(mailHTML); button.setStyleName("okm-Button-Mail"); button.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Window.open("mailto:" + mailTo, "_blank", ""); } }); return button; }
Example #7
Source File: GalleryPage.java From appinventor-extensions with Apache License 2.0 | 6 votes |
/** * Helper method called by constructor to initialize the app action tabs */ private void initActionTabs() { // Add a bunch of tabs for executable actions regarding the app appSecondaryWrapper.addStyleName("clearfix"); appSecondaryWrapper.add(appActionTabs); appActionTabs.addStyleName("app-actions"); appActionTabs.add(appDescPanel, "Description"); appActionTabs.add(appSharePanel, "Share"); appActionTabs.add(appReportPanel, "Report"); appActionTabs.selectTab(0); appActionTabs.addStyleName("app-actions-tabs"); appDetails.add(appSecondaryWrapper); // Return to Gallery link Label returnLabel = new Label("Back to Gallery"); returnLabel.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { ode.switchToGalleryView(); } }); returnToGallery.add(returnLabel); returnToGallery.addStyleName("gallery-nav-return"); returnToGallery.addStyleName("primary-link"); appSecondaryWrapper.add(returnToGallery); // }
Example #8
Source File: GalleryPage.java From appinventor-extensions with Apache License 2.0 | 6 votes |
/** * Helper method called by constructor to initialize the report section */ private void initAppShare() { final HTML sharePrompt = new HTML(); sharePrompt.setHTML(MESSAGES.gallerySharePrompt()); sharePrompt.addStyleName("primary-prompt"); final TextBox urlText = new TextBox(); urlText.addStyleName("action-textbox"); urlText.setText(Window.Location.getHost() + MESSAGES.galleryGalleryIdAction() + app.getGalleryAppId()); urlText.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { urlText.selectAll(); } }); appSharePanel.add(sharePrompt); appSharePanel.add(urlText); }
Example #9
Source File: GalleryPage.java From appinventor-extensions with Apache License 2.0 | 6 votes |
/** * Helper method called by constructor to initialize the edit it button * Only seen by app owner. */ private void initEdititButton() { final User currentUser = Ode.getInstance().getUser(); if(app.getDeveloperId().equals(currentUser.getUserId())){ editButton = new Button(MESSAGES.galleryEditText()); editButton.addClickHandler(new ClickHandler() { // Open up source file if clicked the action button public void onClick(ClickEvent event) { editButton.setEnabled(false); Ode.getInstance().switchToGalleryAppView(app, GalleryPage.UPDATEAPP); } }); editButton.addStyleName("app-action-button"); appAction.add(editButton); } }
Example #10
Source File: GalleryList.java From appinventor-extensions with Apache License 2.0 | 6 votes |
/** * Creates the GUI components for search tab. * * @param searchApp: the FlowPanel that search tab will reside. */ private void addGallerySearchTab(FlowPanel searchApp) { // Add search GUI FlowPanel searchPanel = new FlowPanel(); final TextBox searchText = new TextBox(); searchText.addStyleName("gallery-search-textarea"); Button sb = new Button(MESSAGES.gallerySearchForAppsButton()); searchPanel.add(searchText); searchPanel.add(sb); searchPanel.addStyleName("gallery-search-panel"); searchApp.add(searchPanel); appSearchContent.addStyleName("gallery-search-results"); searchApp.add(appSearchContent); searchApp.addStyleName("gallery-search"); sb.addClickHandler(new ClickHandler() { // @Override public void onClick(ClickEvent event) { gallery.FindApps(searchText.getText(), 0, NUMAPPSTOSHOW, 0, true); } }); }
Example #11
Source File: AboutBox.java From circuitjs1 with GNU General Public License v2.0 | 6 votes |
AboutBox(String version) { super(); vp = new VerticalPanel(); setWidget(vp); vp.setWidth("400px"); vp.add(new HTML("<iframe src=\"help/aboutbox.html\" width=\"400\" height=\"430\" scrolling=\"auto\" frameborder=\"0\"></iframe><br>")); vp.add(okButton = new Button("OK")); okButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { close(); } }); center(); show(); }
Example #12
Source File: ExtendedFlexTable.java From document-management-system with GNU General Public License v2.0 | 6 votes |
/** * ExtendedFlexTable */ public ExtendedFlexTable() { super(); // Adds double click event control to table ( on default only has CLICK ) sinkEvents(Event.ONDBLCLICK | Event.MOUSEEVENTS); addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { // Mark selected row or orders rows if header row (0) is clicked // And row must be other than the selected one markSelectedRow(getCellForEvent(event).getRowIndex()); MessagingToolBarBox.get().messageDashboard.messageStack.proposedSubscriptionReceived.refreshProposedSubscriptions(); } }); }
Example #13
Source File: MithraCacheUi.java From reladomo with Apache License 2.0 | 6 votes |
public void onSuccess(JvmMemory memory) { jvmPanel.clear(); jvmPanel.add(new BoldLabel("Total Memory: ")); jvmPanel.add(new Label(formatLong(memory.getTotalMemory()))); jvmPanel.add(new BoldLabel("Free Memory: ")); jvmPanel.add(new Label(formatLong(memory.getFreeMemory()))); jvmPanel.add(new BoldLabel("Used Memory: ")); jvmPanel.add(new Label(formatLong(memory.getUsed()))); RolloverButton gcButton = new RolloverButton("Force GC", images.forceGcOn(), images.forceGcOff()); gcButton.addClickHandler(new ClickHandler() { public void onClick( ClickEvent sender ) { forceGc(); } }); jvmPanel.add(gcButton); }
Example #14
Source File: AbstractPaletteItemWidget.java From appinventor-extensions with Apache License 2.0 | 6 votes |
AbstractPaletteItemWidget(SimpleComponentDescriptor scd, ImageResource image) { this.scd = scd; AbstractImagePrototype.create(image).applyTo(this); this.addStyleName("ode-SimplePaletteItem-button"); addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { handleClick(); } }); addTouchStartHandler(new TouchStartHandler() { @Override public void onTouchStart(TouchStartEvent touchStartEvent) { // Otherwise captured by SimplePaletteItem touchStartEvent.stopPropagation(); } }); addTouchEndHandler(new TouchEndHandler() { @Override public void onTouchEnd(TouchEndEvent touchEndEvent) { handleClick(); } }); }
Example #15
Source File: HelloWorld.java From document-management-system with GNU General Public License v2.0 | 6 votes |
public HelloWorld() { HTML html = new HTML("Hello Word"); refresh = new Button("refresh UI"); refresh.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { GeneralComunicator.refreshUI(); } }); vPanel = new VerticalPanel(); vPanel.add(html); vPanel.add(refresh); refresh.setStyleName("okm-Input"); initWidget(vPanel); }
Example #16
Source File: DropDownButton.java From appinventor-extensions with Apache License 2.0 | 6 votes |
public DropDownButton(String widgetName, Image icon, List<DropDownItem> toolbarItems, boolean rightAlign) { super(icon); // icon for button this.menu = new ContextMenu(); this.items = new ArrayList<MenuItem>(); this.rightAlign = rightAlign; for (DropDownItem item : toolbarItems) { if (item != null) { addItem(item); } else { menu.addSeparator(); } } addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { menu.setPopupPositionAndShow(new DropDownPositionCallback(getElement())); } }); }
Example #17
Source File: DropDownButton.java From appinventor-extensions with Apache License 2.0 | 6 votes |
public DropDownButton(String widgetName, String caption, List<DropDownItem> toolbarItems, boolean rightAlign) { super(caption + " \u25BE "); // drop down triangle this.menu = new ContextMenu(); this.items = new ArrayList<MenuItem>(); this.rightAlign = rightAlign; for (DropDownItem item : toolbarItems) { if (item != null) { this.items.add(menu.addItem(item.caption, true, item.command)); } else { menu.addSeparator(); } } addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { menu.setPopupPositionAndShow(new DropDownPositionCallback(getElement())); } }); }
Example #18
Source File: GalleryPage.java From appinventor-extensions with Apache License 2.0 | 6 votes |
/** * Helper method called by constructor to initialize the cancel button */ private void initCancelButton() { cancelButton = new Button(MESSAGES.galleryCancelText()); cancelButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (editStatus==NEWAPP) { Ode.getInstance().switchToProjectsView(); }else if(editStatus==UPDATEAPP){ Ode.getInstance().switchToGalleryAppView(app, GalleryPage.VIEWAPP); } } }); cancelButton.addStyleName("app-action-button"); appAction.add(cancelButton); }
Example #19
Source File: AdditionalChoicePropertyEditor.java From appinventor-extensions with Apache License 2.0 | 5 votes |
/** * Creates a new additional choice dialog. */ protected AdditionalChoicePropertyEditor() { summary = new TextBox(); summary.setReadOnly(true); summary.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { openAdditionalChoiceDialog(); } }); initWidget(summary); }
Example #20
Source File: GalleryPage.java From appinventor-extensions with Apache License 2.0 | 5 votes |
/** * Helper method called by constructor to initialize the publish button */ private void initUpdateButton() { actionButton = new Button(MESSAGES.galleryUpdateText()); actionButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { if(!checkIfReadyToPublishOrUpdateApp(app)){ return; } actionButton.setEnabled(false); actionButton.setText(MESSAGES.galleryAppUpdating()); final OdeAsyncCallback<Void> updateSourceCallback = new OdeAsyncCallback<Void>( MESSAGES.galleryError()) { @Override public void onSuccess(Void result) { gallery.appWasChanged(); // to update the gallery list and page Ode.getInstance().switchToGalleryAppView(app, GalleryPage.VIEWAPP); } @Override public void onFailure(Throwable caught) { Window.alert(MESSAGES.galleryNoExtensionsPlease()); actionButton.setEnabled(true); actionButton.setText(MESSAGES.galleryUpdateText()); } }; Ode.getInstance().getGalleryService().updateApp(app,imageUploaded,updateSourceCallback); } }); actionButton.addStyleName("app-action-button"); appAction.add(actionButton); }
Example #21
Source File: EditDatasetPanel.java From EasyML with Apache License 2.0 | 5 votes |
@Override public void init(){ grid = new DescribeGrid(labarr, "data"); verticalPanel.add(grid); grid.addStyleName("bda-descgrid-data"); updatebt.setStyleName("bda-fileupdate-btn"); verticalPanel.add(updatebt); updatebt.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { dbController.submitEditDataset2DB(EditDatasetPanel.this,tree,node,dataset ,grid); } }); }
Example #22
Source File: ProfilePage.java From appinventor-extensions with Apache License 2.0 | 5 votes |
/** * Creates the GUI components for a regular app tab. * This method resides here because it needs access to global variables. * @param container: the FlowPanel that this app tab will reside. * @param content: the sub-panel that contains the actual app content. */ private void addGalleryAppTab(FlowPanel container, FlowPanel content, final String incomingUserId) { // Search specific generalTotalResultsLabel = new Label(); container.add(generalTotalResultsLabel); final OdeAsyncCallback<GalleryAppListResult> byAuthorCallback = new OdeAsyncCallback<GalleryAppListResult>( // failure message MESSAGES.galleryError()) { @Override public void onSuccess(GalleryAppListResult appsResult) { refreshApps(appsResult,false); } }; Ode.getInstance().getGalleryService().getDeveloperApps(userId,appCatalogCounter ,NUMAPPSTOSHOW, byAuthorCallback); container.add(content); buttonNext = new Label(); buttonNext.setText(MESSAGES.galleryMoreApps()); buttonNext.addStyleName("active"); FlowPanel next = new FlowPanel(); next.add(buttonNext); next.addStyleName("gallery-nav-next"); container.add(next); buttonNext.addClickHandler(new ClickHandler() { // @Override public void onClick(ClickEvent event) { if (!appCatalogExhausted) { // If the next page still has apps to retrieve, do it appCatalogCounter += NUMAPPSTOSHOW; Ode.getInstance().getGalleryService().getDeveloperApps(userId,appCatalogCounter ,NUMAPPSTOSHOW, byAuthorCallback); } } }); }
Example #23
Source File: Preview.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * Preview */ public Preview(final HasPreviewEvent previewEvent) { this.previewEvent = previewEvent; widgetPreviewExtensionList = new ArrayList<PreviewExtension>(); vPanel = new VerticalPanel(); htmlPreview = new HTMLPreview(); syntaxHighlighterPreview = new SyntaxHighlighterPreview(); pdf = new HTML("<div id=\"pdfembededcontainer\"></div>\n"); swf = new HTML("<div id=\"pdfviewercontainer\"></div>\n"); video = new HTML("<div id=\"mediaplayercontainer\"></div>\n"); hReturnPanel = new HorizontalPanel(); hReturnPanel.setWidth("100%"); backButton = new Button(Main.i18n("search.button.preview.back")); backButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { previewEvent.returnBack(); } }); backButton.setStylePrimaryName("okm-Button"); HTML space2 = Util.hSpace("5px"); hReturnPanel.add(space2); hReturnPanel.add(backButton); hReturnPanel.setCellWidth(space2, "5px"); hReturnPanel.setCellHorizontalAlignment(backButton, HasAlignment.ALIGN_LEFT); hReturnPanel.setCellVerticalAlignment(backButton, HasAlignment.ALIGN_MIDDLE); hReturnPanel.setHeight(String.valueOf(TURN_BACK_HEIGHT) + "px"); hReturnPanel.setStyleName("okm-TopPanel"); hReturnPanel.addStyleName("okm-Border-Top"); hReturnPanel.addStyleName("okm-Border-Left"); hReturnPanel.addStyleName("okm-Border-Right"); embeddedPreview = new EmbeddedPreview(); initWidget(vPanel); }
Example #24
Source File: ForumToolBarEditor.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * getColorPanel * * @return */ public Widget getColorPanel() { String color[] = {"00", "40", "80", "bf", "ff"}; tableColor = new FlexTable(); tableColor.setCellPadding(0); tableColor.setCellSpacing(1); for (int i = 0; i < color.length; i++) { int col = 0; for (int x = 0; x < color.length; x++) { for (int y = 0; y < color.length; y++) { HTML square = new HTML(""); square.setPixelSize(15, 10); square.setStyleName("okm-Hyperlink"); final String hexColor = "#" + color[i] + color[x] + color[y]; square.setTitle(hexColor); square.getElement().getStyle().setProperty("backgroundColor", hexColor); tableColor.setWidget(i, col, square); square.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { addTag("[color=" + hexColor + "]", "[/color]"); } }); col++; } } } tableColor.setHTML(5, 0, ""); tableColor.getCellFormatter().setHeight(5, 0, "5px"); tableColor.getFlexCellFormatter().setRowSpan(5, 0, 25); tableColor.setVisible(false); return tableColor; }
Example #25
Source File: ETLPopPanel.java From EasyML with Apache License 2.0 | 5 votes |
/** * Bind event to connect button */ private void addConnectHandeler(){ connectBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { tableLB.clear(); columnLB.clear(); connectBtn.setEnabled(false); gettable(); } }); }
Example #26
Source File: WizardPopup.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * Accept button */ private Button acceptButton() { Button button = new Button(Main.i18n("button.accept"), new ClickHandler() { @Override public void onClick(ClickEvent event) { actualButton.setEnabled(false); executeActionButton(); } }); button.setStyleName("okm-YesButton"); button.setEnabled(false); return button; }
Example #27
Source File: WikiToolBarEditor.java From document-management-system with GNU General Public License v2.0 | 5 votes |
/** * getColorPanel * * @return */ public Widget getColorPanel() { String color[] = {"00", "40", "80", "bf", "ff"}; tableColor = new FlexTable(); tableColor.setCellPadding(0); tableColor.setCellSpacing(1); for (int i = 0; i < color.length; i++) { int col = 0; for (int x = 0; x < color.length; x++) { for (int y = 0; y < color.length; y++) { HTML square = new HTML(""); square.setPixelSize(15, 10); square.setStyleName("okm-Hyperlink"); final String hexColor = "#" + color[i] + color[x] + color[y]; square.setTitle(hexColor); square.getElement().getStyle().setProperty("backgroundColor", hexColor); tableColor.setWidget(i, col, square); square.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { addTag("[color=" + hexColor + "]", "[/color]"); } }); col++; } } } tableColor.setHTML(5, 0, ""); tableColor.getCellFormatter().setHeight(5, 0, "5px"); tableColor.getFlexCellFormatter().setRowSpan(5, 0, 25); tableColor.setVisible(false); return tableColor; }
Example #28
Source File: ToolBarButtonExample.java From document-management-system with GNU General Public License v2.0 | 5 votes |
public ToolBarButtonExample() { button = new ToolBarButton(new Image(OKMExtensionBundleExampleResources.INSTANCE.box()), title, new ClickHandler() { @Override public void onClick(ClickEvent event) { Window.alert("make some operation"); } }); }
Example #29
Source File: PersonPanelView.java From demo-gwt-springboot with Apache License 2.0 | 5 votes |
@Override public void init() { // Standard event handling filterButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { logger.info("Click Detected by Simple Click Event"); logger.info("Button Filter is clicked!!!" + clickEvent.getNativeEvent().getString()); eventBus.fireEvent(new SearchEvent()); callApple(); filterPerson(); } }); logger.info("PersonPanelView created..."); initTableColumns(dataGrid1); initTableColumns(dataGrid2); initListDataProvider(dataGrid1); initFilterDataProvider(dataGrid2); getPersons(); // Event handling with Lambda searchButton.addClickHandler(clickHandler -> searchButtonClick("Click Detected by Lambda Listener")); }
Example #30
Source File: ETLPopPanel.java From EasyML with Apache License 2.0 | 5 votes |
/** * Bind event to submit button */ private void addSubmitHandler() { submitBtn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent clickEvent) { logger.info(widget.getProgram().getPath()); if(tableLB.getItemCount()==0) {Window.alert("Please make sure the database is properly connected!");return;} if(panel!= null) setParameterPanel(panel); ETLPopPanel.this.hide(); } }); }