@Override
public List<ToolbarItem> getObject() {
List<ToolbarItem> items = getToolbarItems();
if(addStretch() && items != null && !items.isEmpty()) {
items.add(new ToolbarItem(LAST_ITEM_IDX) {
private static final long serialVersionUID = 1L;
@Override
public void onAttach(ListItem<ToolbarItem> item) {
item.add(new AttributeAppender("class", " stretchCell"));
}
@Override
public Component getComponent(String toolbarItemId) {
return new EmptyPanel(toolbarItemId);
}
});
}
Collections.sort(items);
return items;
}
@Override
public void setObject(List<ToolbarItem> object) {}
};
toolbar = new ListView<ToolbarItem>(CKEY_TOOLBAR_GROUPS, itemsModel) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<ToolbarItem> item) {
ToolbarItem toolbarItem = item.getModelObject();
toolbarItem.onAttach(item);
item.add(toolbarItem.getComponent(CKEY_TOOLBAR_ITEM));
}
};
toolbar.setOutputMarkupId(true);
toolbarContainer = new MarkupContainer(CKEY_TOOLBAR_CONTAINER) {