add(theForm);
List<ITab> tabs = new ArrayList<ITab>();
// add the "well known" tabs
tabs.add(new AbstractTab(new org.apache.wicket.model.ResourceModel(
"ResourceConfigurationPage.Data")) {
public Panel getPanel(String panelID) {
return new DataLayerEditTabPanel(panelID, myLayerModel);
}
});
tabPanelCustomModels.put(DataLayerEditTabPanel.class, null);
tabs.add(new AbstractTab(new org.apache.wicket.model.ResourceModel(
"ResourceConfigurationPage.Publishing")) {
public Panel getPanel(String panelID) {
return new PublishingLayerEditTabPanel(panelID, myLayerModel);
}
});
tabPanelCustomModels.put(PublishingLayerEditTabPanel.class, null);
// add the tabs contributed via extension point
List<LayerEditTabPanelInfo> tabPanels = getGeoServerApplication().getBeansOfType(
LayerEditTabPanelInfo.class);
// sort the tabs based on order
Collections.sort(tabPanels, new Comparator<LayerEditTabPanelInfo>() {
public int compare(LayerEditTabPanelInfo o1, LayerEditTabPanelInfo o2) {
Integer order1 = o1.getOrder() >= 0 ? o1.getOrder() : Integer.MAX_VALUE;
Integer order2 = o2.getOrder() >= 0 ? o2.getOrder() : Integer.MAX_VALUE;
return order1.compareTo(order2);
}
});
for (LayerEditTabPanelInfo tabPanelInfo : tabPanels) {
String titleKey = tabPanelInfo.getTitleKey();
IModel titleModel = null;
if (titleKey != null) {
titleModel = new org.apache.wicket.model.ResourceModel(titleKey);
} else {
titleModel = new Model(tabPanelInfo.getComponentClass().getSimpleName());
}
final Class<LayerEditTabPanel> panelClass = tabPanelInfo.getComponentClass();
IModel<?> panelCustomModel = tabPanelInfo.createOwnModel(myResourceModel, myLayerModel, isNew);
tabPanelCustomModels.put(panelClass, panelCustomModel);
tabs.add(new AbstractTab(titleModel) {
private final Class<LayerEditTabPanel> panelType = panelClass;
@Override
public Panel getPanel(String panelId) {
LayerEditTabPanel tabPanel;
final IModel<?> panelCustomModel = tabPanelCustomModels.get(panelType);