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

The following examples show how to use com.google.gwt.uibinder.client.UiHandler. These examples are extracted from open source projects. 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 Project: demo-gwt-springboot   Source File: PersonPanelView.java    License: Apache License 2.0 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
Source Project: gwt-material-demo   Source File: CountUpView.java    License: Apache License 2.0 6 votes vote down vote up
@UiHandler("btnStart")
void onStart(ClickEvent e) {
    countUp.setStartValue(txtStart.getValue());
    countUp.setEndValue(txtEnd.getValue());
    countUp.setDecimals(txtDecimals.getValue());
    countUp.setDuration(txtDuration.getValue());
    countUp.setDecimal(txtDecimal.getValue());
    countUp.setSeparator(txtSeparator.getValue());
    countUp.setPrefix(txtPrefix.getValue());
    countUp.setSuffix(txtSuffix.getValue());

    if (cbCallback.getValue()) {
       countUp.setCallback(() -> {
           MaterialToast.fireToast("Complete");
       });
    } else {
        countUp.setCallback(() -> {});
    }

    countUp.start();
}
 
Example 3
Source Project: gwt-material-demo   Source File: PathAnimatorShowcase.java    License: Apache License 2.0 6 votes vote down vote up
@UiHandler("btnPause")
void onPause(ClickEvent e){
    // Execute the close callback animation
    MaterialPathAnimator.reverseAnimate(btnFAB.getElement(), musicPanel.getElement(), () -> {
        // Setting the visibility of the FAB for reverse animation
        new MaterialAnimation().transition(Transition.ZOOMIN).animate(btnFAB);
        btnFAB.setVisibility(Style.Visibility.VISIBLE);
        btnFAB.setOpacity(1);

        // Hide the music panel once the pause button is clicked
        musicPanel.setVisibility(Style.Visibility.HIDDEN);
        musicPanel.setOpacity(0);

        // Setting the previous music label with Bounce down animation
        lblMusic.setText("Lady Gaga / Telephone");
        new MaterialAnimation().transition(Transition.BOUNCEINDOWN).animate(lblMusic);

        // Setting the image of the artist
        imgMusic.setUrl("https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcRi9lfCkLutb7ugJlIjn84qWNoiICopC-Vyx7QQJRHF5E7GlqFG");
    });
}
 
Example 4
Source Project: gwt-boot-samples   Source File: HelloWorldView.java    License: Apache License 2.0 5 votes vote down vote up
@UiHandler("showButton")
void handleShowButtonClick(ClickEvent e) {
	if (bananaCount != 0) {
		foodMultipleSelect.getSelectedItems()
				.forEach(item -> Notify.notify(item.toString()));
	} else {
		notify("No banana, no food.");
	}

	eventBus.fireEvent(new ChangeViewEvent("showButton"));
}
 
Example 5
Source Project: gwt-material-demo   Source File: RichEditorView.java    License: Apache License 2.0 5 votes vote down vote up
@UiHandler("getValue")
void onGetValue(ClickEvent e) {
    String value = clearRichEditor.getValue();
    if (value.isEmpty()) {
        value = "Empty";
    }
    MaterialToast.fireToast(value);
}
 
Example 6
Source Project: gwt-material-demo   Source File: LoaderView.java    License: Apache License 2.0 5 votes vote down vote up
@UiHandler("btnShowProgress")
void onShowProgress(ClickEvent e) {
    MaterialLoader.progress(true);
    Timer t = new Timer() {
        @Override
        public void run() {
            MaterialLoader.progress(false);
        }
    };
    t.schedule(3000);
}
 
Example 7
Source Project: gwt-material-demo   Source File: LoadingStateView.java    License: Apache License 2.0 5 votes vote down vote up
@UiHandler("login")
void login(ClickEvent e) {
    appLoadingState.setState(State.LOADING, "Loggin in", "Please wait while logging in your account.");
    Scheduler.get().scheduleFixedDelay(() -> {
        if (errorSuccess.getValue()) {
            appLoadingState.setState(State.SUCCESS, "Successfully logged in", "You are now redirected to homepage.");
        } else {
            appLoadingState.setState(State.ERROR, "Failed logging in", "Please check your login credentials.");
        }
        return false;
    }, 2000);
}
 
Example 8
Source Project: gwt-material-demo   Source File: ComboBoxView.java    License: Apache License 2.0 5 votes vote down vote up
@UiHandler("btnAddOption")
void onAddOption(ClickEvent e) {
    State newState = new State("Item " + dynamicIndex, "I" + dynamicIndex);
    comboTimeZone16.addItem(newState.getName(), newState);
    comboTimeZone16.setSingleValue(newState);
    dynamicIndex ++;
}
 
Example 9
Source Project: gwt-material-demo   Source File: LoaderView.java    License: Apache License 2.0 5 votes vote down vote up
@UiHandler("btnLoader")
void onShowLoaderSpecific(ClickEvent e) {
    MaterialLoader.loading(true, loaderCard);
    btnProgress.setEnabled(false);
    Timer timer = new Timer() {
        @Override
        public void run() {
            btnProgress.setEnabled(true);
            MaterialLoader.loading(false);
        }
    };
    timer.schedule(2000);
}
 
Example 10
Source Project: gwt-material-demo   Source File: ComboBoxView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("btnSetValue")
void onSetCalifornia(ClickEvent e) {
    State california = comboTimeZone13.getValues().get(2);
    comboTimeZone13.setSingleValue(california);
}
 
Example 11
Source Project: gwt-material-demo   Source File: RadioButtonView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("btnRadioValueEvent")
void onClickRadioValueEvent(ClickEvent e) {
    radioValue.setValue(false, true);
}
 
Example 12
Source Project: gwt-material-demo   Source File: RichEditorView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("eventRichEditor")
void onFocus(FocusEvent e) {
    MaterialToast.fireToast("Focus Event : " + eventRichEditor.getHTML());
}
 
Example 13
Source Project: gwt-material-demo   Source File: SteppersView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler({"btnPrev31", "btnPrev32", "btnPrev33"})
void onPrevStep2(ClickEvent e){
    stepperDialog.prevStep();
}
 
Example 14
Source Project: appinventor-extensions   Source File: NoProjectDialogBox.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("goToPurr")
void handleGoToPurr(ClickEvent e) {
  this.hide();
  new TemplateUploadWizard().createProjectFromExistingZip("HelloPurr", new NewTutorialProject());
}
 
Example 15
Source Project: appinventor-extensions   Source File: NoProjectDialogBox.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("goToTalk")
void handleGoToTalk(ClickEvent e) {
  this.hide();
  TemplateUploadWizard.openProjectFromTemplate("http://appinventor.mit.edu/yrtoolkit/yr/aiaFiles/talk_to_me/TalkToMe.asc", new NewTutorialProject());
}
 
Example 16
Source Project: gwt-material-demo   Source File: WindowView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("btnWindowTab")
void onOpenWindowWithTab(ClickEvent e) {
    windowTab.open();
}
 
Example 17
Source Project: gwt-material-demo   Source File: AutoCompleteView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("loadSuggestions")
void loadSuggestions(ClickEvent e) {
    UserOracle oracle = new UserOracle();
    oracle.addContacts(getAllUsers());
    acDynamic.setSuggestions(oracle);
}
 
Example 18
Source Project: gwt-material-patterns   Source File: GoogleDriveView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("btnSearch")
void onSearch(ClickEvent e) {
    appNav.setVisible(false);
    searchNav.setVisible(true);
}
 
Example 19
Source Project: gwt-material-demo   Source File: SteppersView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("btnDialog")
void onOpenDialog(ClickEvent e){
    dialogStepper.open();
}
 
Example 20
Source Project: gwt-material-demo   Source File: DialogsView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("btnEvents")
void onEvents(ClickEvent e) {
    dialogEvents.open();
}
 
Example 21
Source Project: gwt-material-patterns   Source File: GoogleDriveView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("sortFileName")
void onSortFileName(ClickEvent e) {
    List<DriveDTO> sortedFiles = DataHelper.getAllDrives();
    Collections.sort(sortedFiles, (o1, o2) -> o1.getFileName().compareToIgnoreCase(o2.getFileName()));
    populateFiles(sortedFiles);
}
 
Example 22
Source Project: gwt-material-demo   Source File: CameraView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("capture")
void capture(ClickEvent e) {
    String url = camera.captureToDataURL();
    imageCapture.setUrl(url);
    imageCapturedPanel.setVisible(true);
}
 
Example 23
Source Project: gwt-material-patterns   Source File: GoogleDriveView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("sortSharedDate")
void onSortSharedDate(ClickEvent e) {
    List<DriveDTO> sortedFiles = DataHelper.getAllDrives();
    Collections.sort(sortedFiles, (o1, o2) -> o1.getDate().compareToIgnoreCase(o2.getDate()));
    populateFiles(sortedFiles);
}
 
Example 24
Source Project: gwt-material-demo   Source File: ErrorsView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("btnHelperRange")
void onHelperRange(ClickEvent e) {
    range.setHelperText("This is a helper text for range");
}
 
Example 25
Source Project: gwt-material-demo   Source File: PathAnimatorView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("btnCloseCol7")
void onCloseCol7(ClickEvent e) {
    MaterialPathAnimator.reverseAnimate(col7.getElement(), panelTargetCol7.getElement());
}
 
Example 26
Source Project: gwt-material-demo   Source File: SteppersView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler({"btnSuccess", "btnSuccess1", "btnSuccess2"})
void onSuccess(ClickEvent e){
    stepperError.nextStep();
}
 
Example 27
Source Project: gwt-material-demo   Source File: ComboBoxView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("btnComboValueEvent")
void onComboValueEvent(ClickEvent e) {
    comboValue.setSingleValue(comboValue.getValues().get(0), true);
}
 
Example 28
Source Project: gwt-material-patterns   Source File: CustomerCollapsible.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("colapsItem")
void onColapsItem(ClickEvent e){
    googleContactsView.openProfileOverlay(this);
}
 
Example 29
Source Project: gwt-material-demo   Source File: ErrorsView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler("btnErrorRange")
void onErrorRange(ClickEvent e) {
    range.setErrorText("This is an error message for range.");
}
 
Example 30
Source Project: gwt-material-demo   Source File: SteppersView.java    License: Apache License 2.0 4 votes vote down vote up
@UiHandler({"btnContinue01", "btnContinue02", "btnContinue03"})
void onNextStep0(ClickEvent e){
    stepperHori.nextStep();
}