use of com.evolveum.midpoint.web.component.AjaxTabbedPanel in project midpoint by Evolveum.
the class PageResource method createTabsPanel.
private AjaxTabbedPanel<ITab> createTabsPanel() {
List<ITab> tabs = new ArrayList<ITab>();
tabs.add(new PanelTab(createStringResource("PageResource.tab.details")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ResourceDetailsTabPanel(panelId, resourceModel, PageResource.this);
}
});
tabs.add(new PanelTab(createStringResource("PageResource.tab.content.tasks")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ResourceTasksPanel(panelId, true, resourceModel, PageResource.this);
}
});
tabs.add(new PanelTab(createStringResource("PageResource.tab.content.account")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ResourceContentTabPanel(panelId, ShadowKindType.ACCOUNT, resourceModel, PageResource.this);
}
});
tabs.add(new PanelTab(createStringResource("PageResource.tab.content.entitlement")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ResourceContentTabPanel(panelId, ShadowKindType.ENTITLEMENT, resourceModel, PageResource.this);
}
});
tabs.add(new PanelTab(createStringResource("PageResource.tab.content.generic")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ResourceContentTabPanel(panelId, ShadowKindType.GENERIC, resourceModel, PageResource.this);
}
});
tabs.add(new PanelTab(createStringResource("PageResource.tab.content.others")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ResourceContentTabPanel(panelId, null, resourceModel, PageResource.this);
}
});
tabs.add(new PanelTab(createStringResource("PageResource.tab.connector")) {
private static final long serialVersionUID = 1L;
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ResourceConnectorPanel(panelId, null, resourceModel, PageResource.this);
}
});
AjaxTabbedPanel<ITab> resourceTabs = new AjaxTabbedPanel<ITab>(ID_TAB_PANEL, tabs) {
private static final long serialVersionUID = 1L;
@Override
protected void onTabChange(int index) {
updateBreadcrumbParameters(PARAMETER_SELECTED_TAB, index);
}
};
resourceTabs.setOutputMarkupId(true);
return resourceTabs;
}
use of com.evolveum.midpoint.web.component.AjaxTabbedPanel in project midpoint by Evolveum.
the class AbstractOrgTabPanel method initLayout.
private void initLayout() {
final IModel<List<ITab>> tabModel = new LoadableModel<List<ITab>>(false) {
private static final long serialVersionUID = 1L;
@Override
protected List<ITab> load() {
LOGGER.debug("Loading org. roots for tabs for tabbed panel.");
roots = loadOrgRoots();
final List<ITab> tabs = new ArrayList<>();
for (PrismObject<OrgType> root : roots) {
final String oid = root.getOid();
tabs.add(new AbstractTab(createTabTitle(root)) {
private static final long serialVersionUID = 1L;
private int tabId = tabs.size();
@Override
public WebMarkupContainer getPanel(String panelId) {
add(new AjaxEventBehavior("load") {
private static final long serialVersionUID = 1L;
protected void onEvent(final AjaxRequestTarget target) {
SessionStorage storage = getPageBase().getSessionStorage();
storage.getUsers().setSelectedTabId(tabId);
}
});
Panel panel = createTreePanel(panelId, new Model(oid), getPageBase());
panel.setOutputMarkupId(true);
return panel;
}
});
}
LOGGER.debug("Tab count is {}", new Object[] { tabs.size() });
return tabs;
}
};
final SessionStorage storage = getPageBase().getSessionStorage();
int selectedTab = storage.getUsers().getSelectedTabId() == -1 ? 0 : storage.getUsers().getSelectedTabId();
List<ITab> tabsList = tabModel.getObject();
if (tabsList == null || (selectedTab > tabsList.size() - 1)) {
storage.getUsers().setSelectedTabId(0);
selectedTab = 0;
}
AjaxTabbedPanel<ITab> tabbedPanel = new AjaxTabbedPanel<ITab>(ID_TABS, tabModel.getObject(), new Model<>(selectedTab), null) {
private static final long serialVersionUID = 1L;
@Override
public TabbedPanel<ITab> setSelectedTab(int index) {
changeTabPerformed(index);
return super.setSelectedTab(index);
}
};
tabbedPanel.setOutputMarkupId(true);
if (tabsList == null || tabsList.size() == 0) {
tabbedPanel.setVisible(false);
}
add(tabbedPanel);
}
use of com.evolveum.midpoint.web.component.AjaxTabbedPanel in project midpoint by Evolveum.
the class PageResource method onConfigure.
@Override
protected void onConfigure() {
super.onConfigure();
AjaxTabbedPanel tabbedPanel = (AjaxTabbedPanel) get(ID_TAB_PANEL);
WebComponentUtil.setSelectedTabFromPageParameters(tabbedPanel, getPageParameters(), PARAMETER_SELECTED_TAB);
}
Aggregations