Java Code Examples for com.vaadin.ui.Button.ClickEvent#getComponent()

The following examples show how to use com.vaadin.ui.Button.ClickEvent#getComponent() . 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: AbstractFilterSingleButtonClick.java    From hawkbit with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void processFilterButtonClick(final ClickEvent event) {
    final Button clickedButton = (Button) event.getComponent();
    if (isButtonUnClicked(clickedButton)) {
        /* If same button clicked */
        clickedButton.removeStyleName(SPUIStyleDefinitions.SP_FILTER_BTN_CLICKED_STYLE);
        alreadyClickedButton = null;
        filterUnClicked(clickedButton);
    } else if (alreadyClickedButton != null) {
        /* If button clicked and some other button is already clicked */
        alreadyClickedButton.removeStyleName(SPUIStyleDefinitions.SP_FILTER_BTN_CLICKED_STYLE);
        clickedButton.addStyleName(SPUIStyleDefinitions.SP_FILTER_BTN_CLICKED_STYLE);
        alreadyClickedButton = clickedButton;
        filterClicked(clickedButton);
    } else {
        /* If button clicked and not other button is clicked currently */
        clickedButton.addStyleName(SPUIStyleDefinitions.SP_FILTER_BTN_CLICKED_STYLE);
        alreadyClickedButton = clickedButton;
        filterClicked(clickedButton);
    }
}
 
Example 2
Source File: AbstractFilterMultiButtonClick.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void processFilterButtonClick(final ClickEvent event) {
    final Button clickedButton = (Button) event.getComponent();
    if (isButtonUnClicked(clickedButton)) {
        /* If same button clicked */
        clickedButton.removeStyleName(SPUIStyleDefinitions.SP_FILTER_BTN_CLICKED_STYLE);
        alreadyClickedButtons.remove(clickedButton);
        filterUnClicked(clickedButton);
    } else {
        clickedButton.addStyleName(SPUIStyleDefinitions.SP_FILTER_BTN_CLICKED_STYLE);
        alreadyClickedButtons.add(clickedButton);
        filterClicked(clickedButton);
    }
}
 
Example 3
Source File: ConfirmDialog.java    From sensorhub with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void buttonClick(ClickEvent event)
{
    if (event.getComponent() == okButton)
        confirmed = true;
    this.close();    
}
 
Example 4
Source File: VaadinPaginator.java    From jdal with Apache License 2.0 5 votes vote down vote up
public void buttonClick(ClickEvent event) {
	if (event.getComponent() == next) {
		nextPage();
	}
	else if (event.getComponent() == last) {
		lastPage();
	}
	else if (event.getComponent() == previous) {
		previousPage();
	}
	else if (event.getComponent() == first) {
		firstPage();
	}
}