use of de.tudarmstadt.ukp.clarin.webanno.ui.core.settings.ProjectSettingsPanelRegistryService.ProjectSettingsPanelDecl in project webanno by webanno.
the class ProjectPage method makeTabs.
private List<ITab> makeTabs() {
List<ITab> tabs = new ArrayList<>();
tabs.add(new AbstractTab(Model.of("Details")) {
private static final long serialVersionUID = 6703144434578403272L;
@Override
public Panel getPanel(String panelId) {
return new ProjectDetailPanel(panelId, selectedProject);
}
@Override
public boolean isVisible() {
return selectedProject.getObject() != null;
}
});
// Add the project settings panels from the registry
for (ProjectSettingsPanelDecl psp : projectSettingsPanelRegistryService.getPanels()) {
AbstractTab tab = new AbstractTab(Model.of(psp.label)) {
private static final long serialVersionUID = -1503555976570640065L;
@Override
public Panel getPanel(String aPanelId) {
try {
return ConstructorUtils.invokeConstructor(psp.panel, aPanelId, selectedProject);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
public boolean isVisible() {
return selectedProject.getObject() != null && selectedProject.getObject().getId() != null && psp.condition.applies(selectedProject.getObject());
}
};
tabs.add(tab);
}
return tabs;
}
Aggregations