Example usage for com.vaadin.ui NativeButton equals

List of usage examples for com.vaadin.ui NativeButton equals

Introduction

In this page you can find the example usage for com.vaadin.ui NativeButton equals.

Prototype

@Override
    public boolean equals(Object obj) 

Source Link

Usage

From source file:edu.kit.dama.ui.repo.components.ShareObjectComponent.java

/**
 * Build the main layout of the component.
 *///from  w ww  .j a v  a  2 s  .c  o  m
private void buildMainLayout() {
    shareList = new TwinColSelect();
    shareList.setRows(10);
    shareList.setMultiSelect(true);
    shareList.setImmediate(true);
    shareList.setLeftColumnCaption("Not accessible by");
    shareList.setRightColumnCaption("Accessible by");

    shareList.setWidth("500px");
    shareList.setHeight("400px");

    final NativeButton shareButton = new NativeButton("Share");
    final NativeButton cancelButton = new NativeButton("Cancel");

    Button.ClickListener listener = new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            if (shareButton.equals(event.getButton())) {
                syncShares();
            }
            sharePopup.setPopupVisible(false);
        }
    };

    shareButton.addClickListener(listener);
    cancelButton.addClickListener(listener);

    HorizontalLayout buttonLayout = new HorizontalLayout(cancelButton, shareButton);
    mainLayout = new VerticalLayout(shareList, buttonLayout);
    mainLayout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT);
    mainLayout.setExpandRatio(shareList, .9f);
    mainLayout.setExpandRatio(buttonLayout, .1f);
}