Java Code Examples for com.google.gwt.uibinder.client.UiHandler

The following are top voted examples for showing how to use com.google.gwt.uibinder.client.UiHandler. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: demo-gwt-springboot   File: PersonPanelView.java   View source code 6 votes vote down vote up
@UiHandler("refreshButton")
public void onButtonClick(final ClickEvent event) {
	// Event handling in GWT UiBinder
	logger.info("Click Detected by GWT UiBinder");

	// Both buttons disable
	refreshButton.setEnabled(false);
	filterButton.setEnabled(false);

	List<Option> items = foodMultipleSelect.getSelectedItems();

	if (items.size() != 0 && items.get(0).getValue().equalsIgnoreCase("Mustard")) {
		logger.info("We have mustard...");
		filterButton.setText("Mustard");
	}

	boolean result = runTimerRefreshButton();

	if (result == false) {
		filterButton.setEnabled(false);
	}

	logger.info("Result runTimerRefreshButton: " + result);
}
 
Example 2
Project: gwt-pwa-archetype   File: View3.java   View source code 6 votes vote down vote up
@UiHandler("submit")
void onClick(ClickEvent e) {
  if (date.getValue().isEmpty()) {
    date.setInvalid(date.getValue().isEmpty());
    return;
  }

  if (title.validate() && descr.validate()) {
    Todo todo = new Todo();
    todo.date = date.getValue();
    todo.title = title.getValue();
    todo.description = descr.getValue();
    Polymer.apply(grid.getElement(), "push", "items", todo);
    form.reset();
  }
}
 
Example 3
Project: Wiab.pro   File: SearchPanelWidget.java   View source code 6 votes vote down vote up
@UiHandler("self")
void handleMouseMove(MouseMoveEvent e) {
  Element top = self.getElement();    
  Element target;
  target = e.getNativeEvent().getEventTarget().cast();
  while (!top.equals(target)) {
    if (DigestDomImpl.KIND_DIGEST.equals(target.getAttribute(BuilderHelper.KIND_ATTRIBUTE)) ) {
      handleTouch(byId.get(target.getAttribute(DigestDomImpl.DIGEST_ID_ATTRIBUTE)) );
      return;
    }
    target = target.getParentElement();
    if (target == null) {
      break;
    }
  }    
  handleTouch(null);    
}
 
Example 4
Project: Wiab.pro   File: UpdateIndicatorWidget.java   View source code 6 votes vote down vote up
@UiHandler("self")
void handleClick(ClickEvent e) {
  final Element top = getElement();
  Element target;
  target = e.getNativeEvent().getEventTarget().cast();
  while (!top.equals(target)) {
    if (REFRESH_ATTRIBUTE_VAL.equals(target.getAttribute(REFRESH_ATTRIBUTE))) {
      listener.refresh();
      e.stopPropagation();
      return;
    }
    target = target.getParentElement();
    if (target == null) {
      break;
    }
  }
}
 
Example 5
Project: ontosoft   File: PublishView.java   View source code 6 votes vote down vote up
@UiHandler("permbutton")
void onPermButtonClick(ClickEvent event) {
  permissiondialog.show();
  
  userlist.setVisible(true);
  permlist.setVisible(true);
  
  if (userlist.getItemCount() == 1)
    setUserList();
  if (permlist.getItemCount() == 1)
    setPermissionList();
  
  initAgents();
  initMaterial();
  
  setBrowsePermissionHeader();
  
  Window.scrollTo(0, 0);
}
 
Example 6
Project: ephesoft   File: ImageOverlayPanel.java   View source code 6 votes vote down vote up
@UiHandler("fitToPage")
public void onFitToPageClicked(final ClickEvent event) {
	removeOverlays();
	if (!fitToPageImage) {
		final int viewPortHeight = getViewPortHeight();
		final int viewPortWidth = getViewPortWidth();
		heightBeforeFitToHeight = pageImage.getHeight();
		widthBeforeFitToWidth = pageImage.getWidth();
		double imageWidth = 0;
		double imageHeight = getViewPortHeight();
		float count = 53.0f;
		while (imageHeight > viewPortHeight * 72 / 100) {
			imageWidth = viewPortWidth * count / 100;
			imageHeight = pageImage.getHeight() * imageWidth / pageImage.getWidth();
			count -= 0.1f;
		}
		pageImage.setWidth(Double.toString(imageWidth));
		pageImage.setHeight(Double.toString(imageHeight));
		fitToPageImage = Boolean.TRUE;
	} else {
		fitToPageImage = Boolean.FALSE;
		pageImage.setHeight(heightBeforeFitToHeight.toString());
		pageImage.setWidth(widthBeforeFitToWidth.toString());
	}
}
 
Example 7
Project: ephesoft   File: BatchClassView.java   View source code 6 votes vote down vote up
/**
 * To perform operations on Delete Document button clicked.
 * 
 * @param clickEvent ClickEvent
 */
@UiHandler("deleteDocumentButton")
public void onDeleteDocumentButtonClicked(ClickEvent clickEvent) {
	final String rowIndex = docTypeListView.listView.getSelectedRowIndex();
	int rowCount = docTypeListView.listView.getTableRecordCount();
	if (rowIndex == null || rowIndex.isEmpty()) {
		if (rowCount == 0) {
			ConfirmationDialogUtil.showConfirmationDialog(LocaleDictionary.get().getMessageValue(
					BatchClassManagementMessages.NO_RECORD_TO_DELETE), LocaleDictionary.get().getConstantValue(
					BatchClassManagementConstants.DELETE_DOCUMENT_TITLE), Boolean.TRUE);
		} else {
			ConfirmationDialogUtil.showConfirmationDialog(LocaleDictionary.get().getMessageValue(
					BatchClassManagementMessages.NONE_SELECTED_WARNING), LocaleDictionary.get().getConstantValue(
					BatchClassManagementConstants.DELETE_DOCUMENT_TITLE), Boolean.TRUE);
		}
		return;
	}
	final ConfirmationDialog confirmationDialog = ConfirmationDialogUtil.showConfirmationDialog(LocaleDictionary.get()
			.getMessageValue(BatchClassManagementMessages.DELETE_DOCUMENT_TYPE_CONFORMATION), LocaleDictionary.get()
			.getConstantValue(BatchClassManagementConstants.DELETE_DOCUMENT_TITLE), Boolean.FALSE);

	confirmationDialog.addDialogListener(new DialogListener() {

		@Override
		public void onOkClick() {
			confirmationDialog.hide();
			presenter.onDeleteDocumentButtonClicked(rowIndex);
		}

		@Override
		public void onCancelClick() {
			confirmationDialog.hide();
		}
	});

}
 
Example 8
Project: empiria.player   File: MenuView.java   View source code 5 votes vote down vote up
@UiHandler("searchTextBox")
public void onSearchKeyUp(KeyUpEvent event) {
    if (event.getNativeKeyCode() == KeyCodes.KEY_BACKSPACE) {
        startTimer();
    } else if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
        showExplanationOfFirstItem(true);
    }
}
 
Example 9
Project: empiria.player   File: BookmarkPopupContents.java   View source code 5 votes vote down vote up
@UiHandler("titleTextBox")
public void titleKeyDownHandler(KeyDownEvent event) {
    if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
        presenter.applyBookmark();
    } else if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
        presenter.discardChanges();
    }
}
 
Example 10
Project: empiria.player   File: StickieView.java   View source code 5 votes vote down vote up
@UiHandler("contentText")
public void contentTextKeyPressHandler(KeyPressEvent event) {
    if (takeOverKeyInput) {
        if (firstFocusDone) {
            contentText.setText(contentText.getText() + event.getCharCode());
            event.preventDefault();
            takeOverKeyInput = false;
            firstKeyInputAfterClick = false;
        } else {
            firstFocusDone = true;
        }
    }
}
 
Example 11
Project: gwt-material-patterns   File: GoogleDriveView.java   View source code 5 votes vote down vote up
@UiHandler("iconInfo")
void onInfo(ClickEvent e) {
    if(toggle){
        // show the right nav
        mainHeader.setRight(334);
        mainPanel.setGrid("l9 m9 s12");
        rightPanel.setRight(0);
        toggle = false;
    }else{
        hidePanel();
    }
}
 
Example 12
Project: walkaround   File: LogPanel.java   View source code 5 votes vote down vote up
@UiHandler("self")
void handleClick(ClickEvent e) {
  Element target = e.getNativeEvent().getEventTarget().cast();
  if (play.equals(target)) {
    if (active) {
      setActive(false);
      play.setInnerText("Resume");
    } else {
      setActive(true);
      play.setInnerText("Pause");
    }
  } else if (clear.equals(target)) {
    entries.setInnerHTML("");
  }
}
 
Example 13
Project: walkaround   File: UploadFormPopup.java   View source code 5 votes vote down vote up
@UiHandler("submit")
void handleSubmit(ClickEvent e) {
  Preconditions.checkState(stage == Stage.HAVE_TOKEN);
  // The browser's default action can not be relied upon to submit the form,
  // because this handler is removing the form from the DOM, so a manual
  // submit is required (before hiding the popup).
  e.stopPropagation();
  form.submit();
  popup.hide();
  stage = Stage.UPLOADING_FILE;
  log.log(Level.INFO, "posting file");
  if (listener != null) {
    listener.onUploadStarted(fixFilename(file.getFilename()));
  }
}
 
Example 14
Project: social-analytics   File: AdvSearchView.java   View source code 5 votes vote down vote up
@UiHandler("searchBtn")
void onSearch(ClickEvent e){

    if (advSearchTextBox.getText().equalsIgnoreCase("")){
        advSearchTextBox.setText(" ");
    }

    DateTimeFormat fmt = DateTimeFormat.getFormat("/yyyy/M/d");

    String endDate = null;
    String startDate = null;

    if (searchdpStart.getDate() != null) {
        startDate = fmt.format(searchdpStart.getDate());
    }

    if (searchdpEnd.getDate() != null) {
        endDate = fmt.format(searchdpEnd.getDate());
    }

    String account = searchAccountPicker.getSelectedItemText();
    int searchType = Integer.valueOf(searchTypePicker.getSelectedValue());
    String searchTerm = advSearchTextBox.getText();

    int media = (mediaOnly.getValue() ? 1 : 0);

    SearchEvent searchEvent = new SearchEvent(searchTerm, searchType, account, media, startDate, endDate);

    this.clientFactory.getEventBus().fireEvent(searchEvent);
    advSearch.closeModal();

}
 
Example 15
Project: social-analytics   File: SearchView.java   View source code 5 votes vote down vote up
@UiHandler("moreSearchBtn")
public void onMore(ClickEvent e){

    int nextPage = pageNum + 1;

    searchLoader.setVisible(true);

    JsonpRequestBuilder jsonp = new JsonpRequestBuilder();
    // Set timeout for 30 seconds (30000 milliseconds)
    jsonp.setTimeout(30000);
    jsonp.requestObject(url + nextPage, new AsyncCallback<Mention>() {

        @Override
        public void onFailure(Throwable caught) {
            Window.alert("Failure: " + caught.getMessage());
            searchLoader.setVisible(false);
        }

        @Override
        public void onSuccess(Mention mention) {
            if (mention.getMentions() != null) {
                pageNum++;
                updateSearch(mention.getMentions());
                searchLoader.setVisible(false);
            }
        }
    });
}
 
Example 16
Project: social-analytics   File: TweetsView.java   View source code 5 votes vote down vote up
/**
 * Loads in the next set of 10 tweets using the values of currentAccount, currentDate and pageNum.
 * @param e
 */
@UiHandler("moreTweetsBtn")
public void onMore(ClickEvent e){

    int nextPage = pageNum + 1;

    tweetsLoader.setVisible(true);

    JsonpRequestBuilder jsonp = new JsonpRequestBuilder();
    // Set timeout for 30 seconds (30000 milliseconds)
    jsonp.setTimeout(30000);
    jsonp.requestObject(currentUrl + nextPage, new AsyncCallback<Mention>() {

        @Override
        public void onFailure(Throwable caught) {
            Window.alert("Failure: " + caught.getMessage());
            tweetsLoader.setVisible(false);
        }

        @Override
        public void onSuccess(Mention mention) {
            if (mention.getMentions() != null) {
                pageNum++;
                updateTweetsList(mention.getMentions());
                tweetsLoader.setVisible(false);
            }
        }
    });
}
 
Example 17
Project: GwtErraiMaterialMvcExample   File: Header.java   View source code 5 votes vote down vote up
@UiHandler("loginButton")
void showLoginWindowOrLogout(ClickEvent e) {
    if (loginToolTip.getText().equals("Logout")) {
        AuthenticationChange event = new AuthenticationChange();
        event.setStatus(AuthenticationChange.Authentication.LOGOUT);
        authentication.fire(event);
    } else {
        loginPanel.getWindow().open();
        logger.debug("loginButton");
    }
}
 
Example 18
Project: gwt-pwa-archetype   File: Shell.java   View source code 5 votes vote down vote up
@UiHandler("menu")
void onMenuSelect(IronSelectEvent e) {
  if (!drawer.getPersistent()) {
    drawer.close();
  }

  int idx = Integer.parseInt(menu.getSelected().toString());
  content.setWidget(getView(idx));
}
 
Example 19
Project: Wiab.pro   File: SearchPanelWidget.java   View source code 5 votes vote down vote up
@UiHandler("self")
void handleClick(ClickEvent e) {
  final Element top = self.getElement();    
  Element target;
  target = e.getNativeEvent().getEventTarget().cast();
  while (!top.equals(target)) {
    if (DigestDomImpl.KIND_DIGEST.equals(
        target.getAttribute(BuilderHelper.KIND_ATTRIBUTE))) {
      handleSelect(
          byId.get(target.getAttribute(DigestDomImpl.DIGEST_ID_ATTRIBUTE)),
          e.isControlKeyDown(),
          e.isAltKeyDown());
      e.stopPropagation();
      return;
    } else if (DigestDomImpl.KIND_CHECK.equals(
        target.getAttribute(BuilderHelper.KIND_ATTRIBUTE))) {
      handleCheck(byId.get(
          target.getAttribute(DigestDomImpl.DIGEST_ID_ATTRIBUTE)));
      e.stopPropagation();
      return;
    } else if (showMore.equals(target)) {
      handleShowMoreClicked();
    }
    target = target.getParentElement();
    if (target == null) {
      break;
    }
  }
}
 
Example 20
Project: Wiab.pro   File: ParticipantWidget.java   View source code 5 votes vote down vote up
@UiHandler("self")
void onClick(ClickEvent e) {
  if (marked) {
    unMark();
  } else {
    mark();
  }
}
 
Example 21
Project: Wiab.pro   File: VerticalToolbarButtonWidget.java   View source code 5 votes vote down vote up
@UiHandler("content")
void handleMouseDown(MouseDownEvent e) {
  // Prevent the editor from losing selection focus.
  e.preventDefault();
  e.stopPropagation();
}
 
Example 22
Project: Wiab.pro   File: HorizontalToolbarButtonWidget.java   View source code 5 votes vote down vote up
@UiHandler("self")
void handleMouseDown(MouseDownEvent e) {
  // Prevent the editor from losing selection focus.
  e.preventDefault();
  e.stopPropagation();
}
 
Example 23
Project: Wiab.pro   File: CaptionedImageWidget.java   View source code 5 votes vote down vote up
@UiHandler("image")
void handleClick(ClickEvent e) {
  if (listener != null) {
    listener.onClickImage();
  }

}
 
Example 24
Project: ephesoft   File: ImageOverlayPanel.java   View source code 5 votes vote down vote up
@UiHandler("movePageButton")
public void onMoveButtonClicked(final ClickEvent event) {
	final PageMoveDialog dialogBox = new PageMoveDialog();
	dialogBox.setDialogTitle(LocaleDictionary.get().getConstantValue(ReviewValidateConstants.TITLE_MOVE));
	// List<String> listOfDocumentId =
	// getAllDocumentIdForMove(presenter.document.getIdentifier());
	final List<String> listOfDocumentId = getAllDocumentIdForMove();
	final PageMovePanel pageMovePanel = new PageMovePanel(presenter.page.getIdentifier(), presenter.document.getIdentifier(),
			listOfDocumentId, presenter.batchDTO, dialogBox, presenter);
	dialogBox.setWidth("100%");
	pageMovePanel.setWidth("100%");
	pageMovePanel.setListener(new DialogListener() {

		@Override
		public void onOkClick() {
			presenter.batchDTO = pageMovePanel.getBatch();
			presenter.document = presenter.batchDTO.getDocumentById(pageMovePanel.getMoveToDocumentId());
			presenter.page = presenter.batchDTO.getUpdatedPageInDocument(presenter.document, presenter.page);
			fireEvent(new TreeRefreshEvent(presenter.batchDTO, presenter.document, presenter.page));
		}

		@Override
		public void onCancelClick() {
			presenter.setFocus();
		}
	});
	dialogBox.add(pageMovePanel);
	dialogBox.center();
	dialogBox.show();
	pageMovePanel.movePageButton.setFocus(true);

}
 
Example 25
Project: che   File: GithubImporterPageViewImpl.java   View source code 5 votes vote down vote up
@UiHandler("branch")
void onBranchNameChanged(KeyUpEvent event) {
  if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
    return;
  }
  delegate.onBranchNameChanged(branch.getValue());
}
 
Example 26
Project: gerrit   File: ChangeScreen.java   View source code 5 votes vote down vote up
@UiHandler("reviewMode")
void onReviewMode(@SuppressWarnings("unused") ClickEvent e) {
  fileTableMode = FileTable.Mode.REVIEW;
  refreshFileTable();
  editMode.setVisible(true);
  addFile.setVisible(false);
  deleteFile.setVisible(false);
  renameFile.setVisible(false);
  reviewMode.setVisible(false);
}
 
Example 27
Project: che   File: HotKeysDialogViewImpl.java   View source code 5 votes vote down vote up
@UiHandler("filterInput")
public void onKeyUp(KeyUpEvent keyUpEvent) {
  String value = filterInput.getText();
  if (!filterInput.getText().equals(filteredValue)) {
    filteredValue = value;
    delegate.onFilterValueChanged(value);
  }
}
 
Example 28
Project: ephesoft   File: FieldTypeView.java   View source code 5 votes vote down vote up
/**
 * To perform operations on delete regex Button Click.
 * 
 * @param clickEvent ClickEvent
 */
@UiHandler("deleteRegexBtn")
public void onDeleteRegexButtonClicked(ClickEvent clickEvent) {
	final String identifier = regexListView.listView.getSelectedRowIndex();
	int rowCount = regexListView.listView.getTableRecordCount();
	if (identifier == null || identifier.isEmpty()) {
		if (rowCount == 0) {
			ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get().getMessageValue(
					BatchClassManagementMessages.NO_RECORD_TO_DELETE));
		} else {
			ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get().getMessageValue(
					BatchClassManagementMessages.NONE_SELECTED_WARNING));
		}
		return;
	}
	final ConfirmationDialog confirmationDialog = ConfirmationDialogUtil.showConfirmationDialog(LocaleDictionary.get()
			.getMessageValue(BatchClassManagementMessages.DELETE_REGEX_TYPE_CONFORMATION), LocaleDictionary.get()
			.getConstantValue(BatchClassManagementConstants.DELETE_REGEX_TITLE), Boolean.FALSE);

	confirmationDialog.addDialogListener(new DialogListener() {

		@Override
		public void onOkClick() {
			confirmationDialog.hide();
			presenter.onDeleteRegexBtnClicked(identifier);
		}

		@Override
		public void onCancelClick() {
			confirmationDialog.hide();
		}
	});

}
 
Example 29
Project: ontosoft   File: PublishView.java   View source code 5 votes vote down vote up
@UiHandler("savebutton")
public void onSave(ClickEvent event) {
  final Software tmpsw = softwareform.getSoftware();
  tmpsw.setName(softwarename);
  //savebutton.state().loading();
  this.api.updateSoftware(tmpsw, new Callback<Software, Throwable>() {
    @Override
    public void onSuccess(Software sw) {
      software = sw;
      softwarename = tmpsw.getName();
      piechart.setSoftware(software);
      barchart.setSoftware(software);
      softwareform.setSoftware(software);
      
      //savebutton.state().reset();
      savebutton.setEnabled(false);
      
      //TODO: Save should reset invalid entries ?
      //piechart.fillCategories(true);
      //piechart.setActiveCategoryId(piechart.getActiveCategoryId(), false);
    }
    @Override
    public void onFailure(Throwable exception) { 
      savebutton.state().reset();
    }
  });    
}
 
Example 30
Project: gwt-material-demo   File: DialogsView.java   View source code 5 votes vote down vote up
@UiHandler("btnToastAction")
void onToastAction(ClickEvent e) {
    MaterialLink link = new MaterialLink("UNDO");
    link.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            MaterialToast.fireToast("UNDO DONE");
        }
    });
    new MaterialToast(link).toast("Item Deleted");
}
 
Example 31
Project: ephesoft   File: EditFunctionKeyView.java   View source code 5 votes vote down vote up
@UiHandler("saveButton")
protected void onSaveClicked(ClickEvent clickEvent) {
	if (checkEnteredDetails()) {
		if (!keyName.getText().isEmpty()) {
			if (presenter.checkKeyUsedAlready(keyName.getText())) {
				showKeyErrorDialog("The key is already in use.");
			} else {
				presenter.onSave();
			}
		}
	} else {
		final ConfirmationDialog confirmationDialog = ConfirmationDialogUtil.showConfirmationDialog(LocaleDictionary.get()
				.getMessageValue(BatchClassManagementMessages.ALL_DETAILS_NECESSARY), LocaleDictionary.get().getMessageValue(
				BatchClassManagementMessages.INCOMPLETE_DETAILS), Boolean.TRUE);
		confirmationDialog.addDialogListener(new DialogListener() {

			@Override
			public void onOkClick() {
				confirmationDialog.hide();
			}

			@Override
			public void onCancelClick() {
				// On cancel
			}
		});

	}
}
 
Example 32
Project: che   File: MavenCommandPageViewImpl.java   View source code 5 votes vote down vote up
@UiHandler({"arguments"})
void onArgumentsChanged(KeyUpEvent event) {
  // arguments value may not be updated immediately after keyUp
  // therefore use the timer with zero delay
  new Timer() {
    @Override
    public void run() {
      delegate.onArgumentsChanged();
    }
  }.schedule(0);
}
 
Example 33
Project: gerrit   File: PreferencesBox.java   View source code 5 votes vote down vote up
@UiHandler("whitespaceErrors")
void onWhitespaceErrors(ValueChangeEvent<Boolean> e) {
  prefs.showWhitespaceErrors(e.getValue());
  if (view != null) {
    view.operation(
        () -> {
          boolean s = prefs.showWhitespaceErrors();
          for (CodeMirror cm : view.getCms()) {
            cm.setOption("showTrailingSpace", s);
          }
        });
  }
}
 
Example 34
Project: che   File: ZipImporterPageViewImpl.java   View source code 5 votes vote down vote up
@UiHandler("projectDescription")
void onProjectDescriptionChanged(KeyUpEvent event) {
  if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
    return;
  }
  delegate.projectDescriptionChanged(projectDescription.getValue());
}
 
Example 35
Project: ephesoft   File: AdvancedKVExtractionView.java   View source code 5 votes vote down vote up
/**
 * To capture Value Clicked.
 * 
 * @param clickEvent ClickEvent
 */
@UiHandler("captureValue")
public void captureValueClicked(ClickEvent clickEvent) {
	if (keyValueCoordinates.isMouseStatus()) {
		ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get().getMessageValue(
				BatchClassManagementMessages.MOUSE_NOT_CLICK_ERROR));
		return;
	}
	if (!keyValueCoordinates.isKeyFinalized()) {
		ConfirmationDialogUtil.showConfirmationDialogError(LocaleDictionary.get().getMessageValue(
				BatchClassManagementMessages.KEY_NOT_FINAL_ERROR));
		return;
	}
	captureValueInfo();
}
 
Example 36
Project: che   File: CreateFactoryViewImpl.java   View source code 5 votes vote down vote up
@UiHandler({"factoryName"})
public void onProjectNameChanged(KeyUpEvent event) {
  if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER && createFactoryButton.isEnabled()) {
    delegate.onCreateClicked();
  } else {
    String name = factoryName.getValue();
    if (!Strings.isNullOrEmpty(name) && FACTORY_NAME_PATTERN.test(name)) {
      name = name.replaceAll("[^A-Za-z0-9_]", "-");
      factoryName.setValue(name);
    }
    delegate.onFactoryNameChanged(name);
  }
}
 
Example 37
Project: blogwt   File: SearchPart.java   View source code 5 votes vote down vote up
@UiHandler("frmSearch")
void onSearchSubmit (SubmitEvent event) {
	if (isValid()) {
		PageTypeHelper.show(PageType.SearchPostsPageType,
				txtQuery.getValue());
		txtQuery.setValue("");
	} else {
		showErrors();
	}

	event.cancel();
}
 
Example 38
Project: empiria.player   File: ExplanationViewImpl.java   View source code 4 votes vote down vote up
@UiHandler("backButton")
public void backButtonClick(ClickEvent event) {
    listenerProvider.get().onBackClick();
}
 
Example 39
Project: empiria.player   File: MainView.java   View source code 4 votes vote down vote up
@UiHandler("exitButton")
public void onClick(ClickEvent event) {
    exitJs();
}
 
Example 40
Project: empiria.player   File: MenuView.java   View source code 4 votes vote down vote up
@UiHandler("exitButton")
public void onExitClick(ClickEvent event) {
    menuViewNative.exitJs();
}