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

The following examples show how to use com.google.gwt.uibinder.client.UiHandler. 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: PathAnimatorShowcase.java    From gwt-material-demo with 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 #2
Source File: CountUpView.java    From gwt-material-demo with 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 File: PersonPanelView.java    From demo-gwt-springboot with 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 #4
Source File: LoadingStateView.java    From gwt-material-demo with 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 #5
Source File: RichEditorView.java    From gwt-material-demo with 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 File: LoaderView.java    From gwt-material-demo with 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 File: ComboBoxView.java    From gwt-material-demo with 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 #8
Source File: LoaderView.java    From gwt-material-demo with 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 #9
Source File: HelloWorldView.java    From gwt-boot-samples with 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 #10
Source File: TabsView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnGetTabIndex")
void getTabInde1x(ClickEvent e) {
    MaterialToast.fireToast(tabGetIndex.getTabIndex() + "");
}
 
Example #11
Source File: CameraView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("pause")
void pause(ClickEvent e) {
    camera.pause();
}
 
Example #12
Source File: PathAnimatorView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("col5")
void onCol5(ClickEvent e) {
    MaterialPathAnimator.animate(col5.getElement(), panelTargetCol5.getElement());
}
 
Example #13
Source File: TextFieldView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnTextDoubleGetValue")
void textDoubleGetValue(ClickEvent e) {
    MaterialToast.fireToast(txtDoubleValue.getValue() + "");
}
 
Example #14
Source File: ImageCropperView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("showZoomer")
void showZoomer(ValueChangeEvent<Boolean> event) {
    cropper.setShowZoomer(event.getValue());
    cropper.reload();
}
 
Example #15
Source File: CircularProgressView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnGetValue")
void onGetValue(ClickEvent e) {
    MaterialToast.fireToast("Value: " + circValues.getValue());
}
 
Example #16
Source File: AvatarView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("txtAvatarName")
void onUpdateAvatar(KeyUpEvent e) {
    avatar.setValue(txtAvatarName.getText(), false, autoReload.getValue());
}
 
Example #17
Source File: HelperView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("scrollToMiddle")
void scrollToMiddle(ClickEvent e) {
    scrollHelper.setOffsetPosition(OffsetPosition.MIDDLE);
    scrollHelper.scrollTo(target);
}
 
Example #18
Source File: TimePickersView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnTpValue")
void btnTpValue(ClickEvent e) {
    tpValue.setValue(new Date());
}
 
Example #19
Source File: SteppersView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("stepperHori")
void onFinish0(CompleteEvent e){
    reset(stepperHori);
}
 
Example #20
Source File: TextFieldView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnTextBoxValueEvent")
void onTextBoxValueEvent(ClickEvent e) {
    txtBoxValue.setValue("Text Box 2", true);
}
 
Example #21
Source File: SignaturePadView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("closeDialog")
void closeDialog(ClickEvent e) {
    dataDialog.close();
}
 
Example #22
Source File: ErrorsView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnSuccessTxtBox")
void onSuccessTxtBox(ClickEvent e) {
    txtBox.setSuccessText("This is a success message for text box.");
}
 
Example #23
Source File: ServiceWorkerView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnGetState")
void getState(ClickEvent e) {
    MaterialToast.fireToast(PwaManager.getInstance().getServiceWorkerManager().getServiceWorker().state);
}
 
Example #24
Source File: CoreAnimationsView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnAnimate")
void onAnimateCoreTransition(ClickEvent e) {
    animate();
}
 
Example #25
Source File: InputMaskView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("maskDate")
void maskDate(ValueChangeEvent<Date> event) {
    MaterialToast.fireToast(maskDate.getValue().toString());
}
 
Example #26
Source File: TextFieldView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("validateOutlined")
void validateOutlined(ClickEvent e) {
    outlinedStatesRow.validate();
}
 
Example #27
Source File: ListBoxView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("reload")
void reload(ClickEvent e) {
    lstLazy.reload();
}
 
Example #28
Source File: ComboBoxView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("swState")
void onSwitchState(ValueChangeEvent<Boolean> e) {
    comboTimeZone6.setEnabled(e.getValue());
}
 
Example #29
Source File: ComboBoxView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnComboValue")
void onClickComboValue(ClickEvent e) {
    comboValue.setSingleValue(comboValue.getValues().get(2), false);
}
 
Example #30
Source File: MeaningfulAnimationsView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("btnShowGrid")
void onShowGrid(ClickEvent e) {
    MaterialAnimation gridAnimation = new MaterialAnimation();
    gridAnimation.setTransition(Transition.SHOW_GRID);
    gridAnimation.animate(gridPanel);
}