public class ManageTileNodeTabFactory implements ManageNodeTabFactory {
private static List<IBrixTab> getTabs(final IModel<BrixNode> nodeModel) {
List<IBrixTab> tabs = new ArrayList<IBrixTab>();
tabs.add(new CachingAbstractTab(new ResourceModel("view", "View")) {
@Override
public Panel newPanel(String panelId) {
return new ViewTab(panelId, nodeModel);
}
@Override
public boolean isVisible() {
return hasViewPermission(nodeModel);
}
});
tabs.add(new CachingAbstractTab(new ResourceModel("tiles", "Tiles")) {
@Override
public Panel newPanel(String panelId) {
return new TilesPanel(panelId, nodeModel);
}
@Override
public boolean isVisible() {
return hasEditPermission(nodeModel);
}
});
tabs.add(new CachingAbstractTab(new ResourceModel("variables", "Variables")) {
@Override
public Panel newPanel(String panelId) {
return new VariablesPanel(panelId, nodeModel);
}