@Override
public void setup() {
CheckBox cb = new CheckBox("Item click listener");
cb.setImmediate(true);
cb.addListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
if (((Boolean) event.getProperty().getValue())) {
table.addListener(TableAndBrowserContextMenu.this);
} else {
table.removeListener(TableAndBrowserContextMenu.this);
}
}
});
addComponent(cb);
CheckBox cbActionHandler = new CheckBox("Action handler");
cbActionHandler.setImmediate(true);
cbActionHandler.addListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
if (((Boolean) event.getProperty().getValue())) {
table.addActionHandler(TableAndBrowserContextMenu.this);
} else {
table.removeActionHandler(TableAndBrowserContextMenu.this);
}
}
});
addComponent(cbActionHandler);
CheckBox cbActionHasActions = new CheckBox("Action handler has actions");
cbActionHasActions.setImmediate(true);
cbActionHasActions.addListener(new ValueChangeListener() {
@Override
public void valueChange(ValueChangeEvent event) {
actionHandlerHasActions = ((Boolean) event.getProperty()
.getValue());