Java Code Examples for com.google.gwt.event.dom.client.ClickHandler

The following examples show how to use com.google.gwt.event.dom.client.ClickHandler. These examples are extracted from open source projects.
Example 1
Project: circuitjs1   File: AboutBox.java    License: GNU General Public License v2.0 6 votes vote down vote up
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 2
Project: circuitjs1   File: LicenseDialog.java    License: GNU General Public License v2.0 6 votes vote down vote up
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 3
Project: EasyML   File: BasePopupPanel.java    License: Apache License 2.0 6 votes vote down vote up
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 4
Project: EasyML   File: SaveDatasetPanel.java    License: Apache License 2.0 6 votes vote down vote up
@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
Project: EasyML   File: SqlScriptFileConfigTable.java    License: Apache License 2.0 6 votes vote down vote up
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
Project: document-management-system   File: MailViewer.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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("<", "&lt;").replace(">", "&gt;");
	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
Project: appinventor-extensions   File: GalleryPage.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 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
Project: appinventor-extensions   File: GalleryPage.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 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
Project: appinventor-extensions   File: GalleryPage.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 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
Project: appinventor-extensions   File: GalleryPage.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 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 11
Project: appinventor-extensions   File: GalleryList.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * 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 12
Project: appinventor-extensions   File: DropDownButton.java    License: Apache License 2.0 6 votes vote down vote up
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 13
Project: appinventor-extensions   File: DropDownButton.java    License: Apache License 2.0 6 votes vote down vote up
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 14
Project: document-management-system   File: HelloWorld.java    License: GNU General Public License v2.0 6 votes vote down vote up
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 15
Project: appinventor-extensions   File: AbstractPaletteItemWidget.java    License: Apache License 2.0 6 votes vote down vote up
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 16
Project: reladomo   File: MithraCacheUi.java    License: Apache License 2.0 6 votes vote down vote up
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 17
Project: document-management-system   File: ExtendedFlexTable.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 18
Project: document-management-system   File: ExtendedFlexTable.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 19
Project: EasyML   File: ETLPopPanel.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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();
		}
	});
}
 
Example 20
Project: EasyML   File: ETLPopPanel.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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 21
Project: document-management-system   File: WizardPopup.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Next button
 */
private Button nextButton() {
	Button button = new Button(Main.i18n("button.next"), new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			actualButton.setEnabled(false);
			executeActionButton();
		}
	});
	button.setStyleName("okm-YesButton");
	button.setEnabled(false);
	return button;
}
 
Example 22
Project: EasyML   File: EditDatasetPanel.java    License: Apache License 2.0 5 votes vote down vote up
@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 23
Project: EasyML   File: CategoryPanel.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Event binding
 */
public void bind(){
	close.addClickHandler(new ClickHandler(){

		@Override
		public void onClick(ClickEvent event) {
			// TODO Auto-generated method stub
			CategoryPanel.this.hide();
		}
	});
}
 
Example 24
Project: EasyML   File: JobDescPopupPanel.java    License: Apache License 2.0 5 votes vote down vote up
public JobDescPopupPanel(String title) {

		Label label = new Label(title);
		label.setStyleName("bda-newjob-head");
		verticalPanel.add(label);
		verticalPanel.add(createGrid());
		HorizontalPanel hpanel = new HorizontalPanel();

		hpanel.setStyleName("bda-newjob-hpanel");
		verticalPanel.add(errorLabel);
		Button cancelBtn = new Button(Constants.studioUIMsg.cancel());
		cancelBtn.addClickHandler(new ClickHandler() {

			@Override
			public void onClick(ClickEvent event) {
				JobDescPopupPanel.this.hide();
			}

		});

		hpanel.add(submitBtn);
		hpanel.add(cancelBtn);
		submitBtn.removeStyleName("gwt-Button");
		cancelBtn.removeStyleName("gwt-Button");
		submitBtn.addStyleName("button-style");
		cancelBtn.addStyleName("button-style");
		errorLabel.setStyleName("error-label");
		verticalPanel.add(hpanel);
		verticalPanel.addStyleName("bda-newjob");
		this.setCloseEnable(false);
	}
 
Example 25
Project: EasyML   File: StdPanel.java    License: Apache License 2.0 5 votes vote down vote up
protected void init(String msg, String title) {
	this.setTitle("stdErr");
	this.setGlassEnabled(true);

	HTML closeButton = new HTML("X");
	closeButton.setSize("10px", "10px");
	closeButton.setStyleName("closebtn");
	closeButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			StdPanel.this.hide();
		}
	});

	ScrollPanel scvp = new ScrollPanel();
	VerticalPanel verticalPanel = new VerticalPanel();

	verticalPanel.add(closeButton);
	verticalPanel.setCellHeight(closeButton, "30px");
	verticalPanel.setStyleName("vpanel");
	HTML desc = new HTML(title);
	desc.setStyleName("popupTitle");
	verticalPanel.add(desc);
	verticalPanel.setCellHeight(desc, "30px");

	TextArea label = new TextArea();
	label.setText(msg);
	label.setReadOnly(true);
	label.setSize("650px", "400px");
	verticalPanel.add(label);
	scvp.add(verticalPanel);
	this.add(scvp);
	this.setStyleName("loading_container");
	this.center();
	this.show();
}
 
Example 26
Project: document-management-system   File: TemplateWizardPopup.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * Accept button 
 *
 * @return
 */
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
Project: appinventor-extensions   File: GalleryPage.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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 28
Project: appinventor-extensions   File: ProfilePage.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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 29
Project: document-management-system   File: Preview.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 30
Project: demo-gwt-springboot   File: PersonPanelView.java    License: Apache License 2.0 5 votes vote down vote up
@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 31
Project: appinventor-extensions   File: AdditionalChoicePropertyEditor.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 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 32
Project: document-management-system   File: ToolBarButtonExample.java    License: GNU General Public License v2.0 5 votes vote down vote up
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 33
Project: document-management-system   File: WikiToolBarEditor.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 34
Project: document-management-system   File: WizardPopup.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 35
Project: document-management-system   File: ForumToolBarEditor.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * 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 36
Project: document-management-system   File: DownloadPdfButton.java    License: GNU General Public License v2.0 5 votes vote down vote up
public DownloadPdfButton(List<String> uuidList) {
	if (isRegistered(uuidList)) {
		button = new ToolBarButton(new Image(OKMBundleResources.INSTANCE.downloadPdfDisabled()),
				GeneralComunicator.i18nExtension("download.pdf.button.title"), new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				if (enabled) {
					GeneralComunicator.downloadDocumentPdf();
				}
			}
		});
	}
}
 
Example 37
Project: document-management-system   File: DownloadButton.java    License: GNU General Public License v2.0 5 votes vote down vote up
public DownloadButton(List<String> uuidList) {
	if (isRegistered(uuidList)) {
		button = new ToolBarButton(new Image(OKMBundleResources.INSTANCE.downloadDisabled()),
				GeneralComunicator.i18nExtension("download.button.title"), new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				if (enabled) {
					GeneralComunicator.downloadDocument(false);
				}
			}
		});
	}
}
 
Example 38
Project: document-management-system   File: ProposedQueryReceivedUserInfoImage.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * ProposedSubscriptionUserInfoImage
 */
public ProposedQueryReceivedUserInfoImage() {
	image = new Image(OKMBundleResources.INSTANCE.shareQuery());
	image.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.DASHBOARD);
			DashboardComunicator.showToolBoxExtension(MessagingToolBarBox.get().messagingToolBarBox);
			MessagingToolBarBox.get().messageDashboard.messageStack.stackPanel.showWidget(MessageStack.STACK_QUERY_RECEIVED);
		}
	});
	image.setTitle(GeneralComunicator.i18nExtension("messaging.user.info.new.proposed.query"));
	image.setStyleName("okm-Hyperlink");
	initWidget(image);
}
 
Example 39
Project: document-management-system   File: MessageReceivedUserInfoImage.java    License: GNU General Public License v2.0 5 votes vote down vote up
/**
 * MessageReceivedUserInfoImage
 */
public MessageReceivedUserInfoImage() {
	image = new Image(OKMBundleResources.INSTANCE.messageReceived());
	image.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.DASHBOARD);
			DashboardComunicator.showToolBoxExtension(MessagingToolBarBox.get().messagingToolBarBox);
			MessagingToolBarBox.get().messageDashboard.messageStack.stackPanel.showWidget(MessageStack.STACK_MESSAGES_RECEIVED);
		}
	});
	image.setTitle(GeneralComunicator.i18nExtension("messaging.user.info.new.message.received"));
	image.setStyleName("okm-Hyperlink");
	initWidget(image);
}
 
Example 40
Project: circuitjs1   File: HelpDialog.java    License: GNU General Public License v2.0 4 votes vote down vote up
HelpDialog() {
	super();
	vp = new VerticalPanel();
	setWidget(vp);
	setText(sim.LS("Help"));

	TabPanel tp = new TabPanel();
	vp.add(tp);
	String tab1Title = "EN";
	String tab2Title = "RU";
	String tab3Title = "PL";
	String tab4Title = "DE";
	String tab5Title = "DA";

	      //create tabs 
	tp.add(vpEN = new VerticalPanel(), tab1Title);
	vpEN.setWidth("500px");
	vpEN.add(new HTML("<iframe style=\"border:0;\" src=\"help/EN.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));
	
	tp.add(vpRU = new VerticalPanel(), tab2Title);
	vpRU.setWidth("500px");
	vpRU.add(new HTML("<iframe style=\"border:0;\" src=\"help/RU.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));

	tp.add(vpPL = new VerticalPanel(), tab3Title);
	vpPL.setWidth("500px");
	vpPL.add(new HTML("<iframe style=\"border:0;\" src=\"help/PL.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));

	tp.add(vpDE = new VerticalPanel(), tab4Title);
	vpDE.setWidth("500px");
	vpDE.add(new HTML("<iframe style=\"border:0;\" src=\"help/DE.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));

	tp.add(vpDA = new VerticalPanel(), tab5Title);
	vpDA.setWidth("500px");
	vpDA.add(new HTML("<iframe style=\"border:0;\" src=\"help/DA.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));
	
	HorizontalPanel hp = new HorizontalPanel();
	hp.setWidth("100%");
	hp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
	hp.setStyleName("topSpace");
	
	//select first tab
	tp.selectTab(0);

	//set width if tabpanel
	tp.setWidth("500");
	
	vp.add(hp);
	hp.add(okButton = new Button("OK"));
	okButton.addClickHandler(new ClickHandler() {
		public void onClick(ClickEvent event) {
			closeDialog();
		}
	});
	center();
	show();
}