List of usage examples for com.google.gwt.event.dom.client ClickEvent ClickEvent
protected ClickEvent()
From source file:com.google.api.explorer.client.parameter.schema.ArrayElement.java
License:Apache License
@UiHandler("remove") void fireRemoveEvent(ClickEvent event) { // Repackage the click event on the remove button as an event sent to the user supplied handler. handlerManager.fireEvent(new ClickEvent() { });//w ww.ja va 2 s. c o m }
From source file:com.google.api.explorer.client.parameter.schema.ObjectElement.java
License:Apache License
@UiHandler("remove") void removeClicked(ClickEvent event) { // Fire the remove event. handlerManager.fireEvent(new ClickEvent() { }); }
From source file:com.google.code.p.gwtchismes.client.GWTCButton.java
License:Apache License
@Override public void click() { super.fireEvent(new ClickEvent() { }); }
From source file:com.google.gerrit.client.ui.AddIncludedGroupBox.java
License:Apache License
private void doAdd() { addMember.fireEvent(new ClickEvent() { }); }
From source file:com.google.livingstories.client.contentmanager.ContentItemManager.java
License:Apache License
/** * Creates event handlers for the Locations UI. *//*from w w w.j a v a 2s.co m*/ private void createLocationHandlers() { // first, set up interactions between the widgets: final ClickHandler radioHandler = new ClickHandler() { @Override public void onClick(ClickEvent event) { adjustLocationControls(); controlGeocodeButton(); } }; final KeyUpHandler textHandler = new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { controlGeocodeButton(); } }; useDisplayedLocation.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { radioHandler.onClick(event); locationDescriptionTextArea.setFocus(true); } }); useAlternateLocation.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { radioHandler.onClick(event); alternateTextBox.setFocus(true); } }); useManualLatLong.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { radioHandler.onClick(event); latitudeTextBox.setFocus(true); } }); locationDescriptionTextArea.addKeyUpHandler(textHandler); alternateTextBox.addKeyUpHandler(textHandler); latitudeTextBox.addKeyUpHandler(textHandler); longitudeTextBox.addKeyUpHandler(textHandler); // Actually handle the geocode button: geocodeButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (useManualLatLong.getValue()) { // the latitude and longitude textboxes already have the right values in them recenterMap(); } else { String address = (useDisplayedLocation.getValue() ? locationDescriptionTextArea : alternateTextBox).getText(); geocoderStatus.setText(""); new Geocoder().getLatLng(address, new LatLngCallback() { @Override public void onFailure() { geocoderStatus.setText("geocoding failed!"); } @Override public void onSuccess(LatLng point) { geocoderStatus.setText("success"); latitudeTextBox.setText(String.valueOf(point.getLatitude())); longitudeTextBox.setText(String.valueOf(point.getLongitude())); recenterMap(); } }); } } }); map.addMapRightClickHandler(new MapRightClickHandler() { @Override public void onRightClick(MapRightClickEvent event) { LatLng clickedLatLng = map.convertContainerPixelToLatLng(event.getPoint()); latitudeTextBox.setText(String.valueOf(clickedLatLng.getLatitude())); longitudeTextBox.setText(String.valueOf(clickedLatLng.getLongitude())); useManualLatLong.setValue(true); useManualLatLong.fireEvent(new ClickEvent() { }); recenterMap(); } }); }
From source file:com.google.livingstories.plugins.wordpress.livingstorypropertymanager.client.ui.LocationInput.java
License:Apache License
/** * Creates event handlers for the Locations UI. *///from w w w.ja v a 2 s. co m private void createLocationHandlers() { // first, set up interactions between the widgets: final ClickHandler radioHandler = new ClickHandler() { @Override public void onClick(ClickEvent event) { adjustLocationControls(); controlGeocodeButton(); } }; final KeyUpHandler textHandler = new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { controlGeocodeButton(); } }; useDisplayedLocation.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { radioHandler.onClick(event); locationDescriptionTextArea.setFocus(true); } }); useAlternateLocation.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { radioHandler.onClick(event); alternateTextBox.setFocus(true); } }); useManualLatLong.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { radioHandler.onClick(event); latitudeTextBox.setFocus(true); } }); locationDescriptionTextArea.addKeyUpHandler(textHandler); alternateTextBox.addKeyUpHandler(textHandler); latitudeTextBox.addKeyUpHandler(textHandler); longitudeTextBox.addKeyUpHandler(textHandler); // Actually handle the geocode button: geocodeButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (useManualLatLong.getValue()) { // the latitude and longitude textboxes already have the right values in them recenterMap(); } else { String address = (useDisplayedLocation.getValue() ? locationDescriptionTextArea : alternateTextBox).getText(); geocoderStatus.setText(""); new Geocoder().getLatLng(address, new LatLngCallback() { @Override public void onFailure() { geocoderStatus.setText("geocoding failed!"); } @Override public void onSuccess(LatLng point) { geocoderStatus.setText("success"); latitudeTextBox.setText(String.valueOf(point.getLatitude())); longitudeTextBox.setText(String.valueOf(point.getLongitude())); updateHiddenFieldValues(); recenterMap(); } }); } } }); map.addMapRightClickHandler(new MapRightClickHandler() { @Override public void onRightClick(MapRightClickEvent event) { LatLng clickedLatLng = map.convertContainerPixelToLatLng(event.getPoint()); latitudeTextBox.setText(String.valueOf(clickedLatLng.getLatitude())); longitudeTextBox.setText(String.valueOf(clickedLatLng.getLongitude())); useManualLatLong.setValue(true); useManualLatLong.fireEvent(new ClickEvent() { }); updateHiddenFieldValues(); recenterMap(); } }); }
From source file:com.qualogy.qafe.gwt.client.component.QTree.java
License:Apache License
private void fireItemClickEvent(final SelectionEvent<TreeItem> event) { // When a qaml is listening to a tree with its id, and when clicks on parent tree , as the parent tree is also an item // we dont have to do implicit click handling of item. otherwise 2 times the event will be executed. if (isRootItem(event.getSelectedItem())) { return;/*from w w w.ja va 2 s .com*/ } if (rootItem instanceof QTreeItem) { final Label rootItemlabel = ((QTreeItem) rootItem).getLabel(); ClickEvent clickEvent = new ClickEvent() { // This is to make sure that we are making the item id and value available as src-id and src-value @Override public Object getSource() { if (event.getSelectedItem() instanceof QTreeItem) { return ((QTreeItem) event.getSelectedItem()).getLabel(); } return rootItemlabel; } }; rootItemlabel.fireEvent(clickEvent); } }
From source file:com.travelsky.ebuild.hawkeye.client.ui.widget.AbstractCustomButton.java
License:Apache License
void fireClickListeners(@SuppressWarnings("unused") Event nativeEvent) { // TODO(ecc) Once event triggering is committed, should fire a native click event instead. fireEvent(new ClickEvent() { });/*from w w w . j a va2 s . co m*/ }
From source file:cz.cas.lib.proarc.webapp.client.widget.UploadFile.java
License:Open Source License
private void openFileDialog(Uploader uploader) { // workaround to call Uploader.openFileDialog for (int i = uploader.getWidgetCount() - 1; i >= 0; i--) { Widget widget = uploader.getWidget(i); if (widget instanceof com.google.gwt.user.client.ui.Label) { final com.google.gwt.user.client.ui.Label btn = (com.google.gwt.user.client.ui.Label) widget; btn.fireEvent(new ClickEvent() { });/*from w w w.j a va2 s .c om*/ break; } } }
From source file:edu.caltech.ipac.firefly.ui.PopupUtil.java
public static BaseDialog showInputDialog(Widget parent, String msg, String intialValue, int preferWidth, final ClickHandler okHandler, final ClickHandler cancelHandler) { final TextBox text = new TextBox(); text.setVisibleLength(preferWidth);/*w w w. jav a 2 s .com*/ if (!StringUtils.isEmpty(intialValue)) { text.setText(intialValue); } final BaseDialog dialog = new BaseDialog(parent, ButtonType.OK_CANCEL, "Input Dialog", true, null) { protected void inputComplete() { if (okHandler != null) { okHandler.onClick(new ClickEvent() { @Override public Object getSource() { return text.getText(); } }); } } protected void inputCanceled() { if (cancelHandler != null) cancelHandler.onClick(null); } }; text.addKeyPressHandler(new KeyPressHandler() { public void onKeyPress(KeyPressEvent ev) { final char keyCode = ev.getCharCode(); DeferredCommand.addCommand(new Command() { public void execute() { if (keyCode == KeyCodes.KEY_ENTER) { dialog.getButton(BaseDialog.ButtonID.OK).click(); } } }); } }); VerticalPanel vp = new VerticalPanel(); vp.setSpacing(5); vp.add(new HTML("<h3>" + msg + "</h3>")); vp.add(text); dialog.setWidget(vp); dialog.setVisible(true); text.setFocus(true); return dialog; }