use of au.com.vaadinutils.fields.contextmenu.ButtonContextMenu in project VaadinUtils by rlsutton1.
the class GridHeadingV2PropertySet method getActionMenuColumnGenerator.
private PropertyValueGenerator<Component> getActionMenuColumnGenerator() {
return new PropertyValueGenerator<Component>() {
private static final long serialVersionUID = 1L;
@SuppressWarnings("unchecked")
@Override
public Component getValue(Item item, Object itemId, Object propertyId) {
final Button actionMenuButton = new Button(FontAwesome.ELLIPSIS_H);
actionMenuButton.addStyleName(ValoTheme.BUTTON_QUIET);
actionMenuButton.addStyleName(ValoTheme.BUTTON_SMALL);
final ButtonContextMenu<E> contextMenu = new ButtonContextMenu<>();
actionMenuProvider.setup(contextMenu);
contextMenu.setAsButtonContextMenu(actionMenuButton, (E) itemId);
actionMenuButton.addClickListener(new ClickListener() {
/**
*/
private static final long serialVersionUID = 1L;
@Override
public void buttonClick(ClickEvent event) {
contextMenu.openContext(event);
}
});
return actionMenuButton;
}
@Override
public Class<Component> getType() {
return Component.class;
}
};
}
Aggregations