use of com.evolveum.midpoint.web.component.TabbedPanel in project midpoint by Evolveum.
the class PageValuePolicy method initTabs.
private void initTabs(MidpointForm mainForm) {
List<ITab> tabs = new ArrayList<>();
PageBase baseParameter = this;
tabs.add(new AbstractTab(createStringResource("PageValuePolicy.basic")) {
@Override
public WebMarkupContainer getPanel(String panelId) {
return new ValuePolicyBasicPanel(panelId, valuePolicyModel);
}
});
// tabs.add(new AbstractTab(createStringResource("PageValuePolicy.stringPolicy")) {
// @Override
// public WebMarkupContainer getPanel(String panelId) {
// return new ValuePolicyStringPoliciesPanel(panelId,mainForm,valuePolicyModel,baseParameter);
// }
// });
TabbedPanel tabPanel = WebComponentUtil.createTabPanel(ID_TAB_PANEL, this, tabs, null);
mainForm.add(tabPanel);
}
use of com.evolveum.midpoint.web.component.TabbedPanel in project midpoint by Evolveum.
the class SchemaStep method initLayout.
private void initLayout() {
List<ITab> tabs = new ArrayList<>();
tabs.add(createSimpleSchemaView());
tabs.add(createSchemaEditor());
TabbedPanel<ITab> tabPanel = new TabbedPanel<>(ID_TAB_PANEL, tabs);
tabPanel.setOutputMarkupId(true);
add(tabPanel);
AjaxButton reload = new AjaxButton(ID_RELOAD, createStringModel("SchemaStep.button.reload")) {
@Override
public void onClick(AjaxRequestTarget target) {
reloadPerformed(target);
}
};
add(reload);
}
use of com.evolveum.midpoint.web.component.TabbedPanel in project midpoint by Evolveum.
the class StageEditorPanel method nameClickPerformed.
private void nameClickPerformed(AjaxRequestTarget target) {
TabbedPanel tabbedPanel = this.findParent(TabbedPanel.class);
IModel<List<ITab>> tabsModel = tabbedPanel.getTabs();
List<ITab> tabsList = tabsModel.getObject();
PropertyModel<String> tabNameModel;
if (getModel().getObject().getName() == null || getModel().getObject().getName().trim().equals("")) {
tabNameModel = new PropertyModel<>(getModel(), StageDefinitionDto.F_NUMBER);
} else {
tabNameModel = new PropertyModel<>(getModel(), StageDefinitionDto.F_NAME);
}
for (ITab tab : tabsList) {
if (tab.getTitle().getObject().equals(tabNameModel.getObject())) {
int i = tabsList.indexOf(tab);
tabbedPanel.setSelectedTab(i);
target.add(tabbedPanel);
return;
}
}
tabsList.add(new AbstractTab(tabNameModel) {
@Override
public WebMarkupContainer getPanel(String panelId) {
return new DefinitionStagePanel(panelId, getModel());
}
});
tabbedPanel.setSelectedTab(tabsList.size() - 1);
target.add(tabbedPanel);
}
use of com.evolveum.midpoint.web.component.TabbedPanel in project midpoint by Evolveum.
the class PageAssignmentShoppingCart method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
initModels();
getRoleCatalogStorage().setAssignmentRequestLimit(AssignmentsUtil.loadAssignmentsLimit(new OperationResult(OPERATION_LOAD_ASSIGNMENTS_LIMIT), this));
setOutputMarkupId(true);
Form mainForm = new MidpointForm(ID_MAIN_FORM);
add(mainForm);
List<ITab> tabs = getTabsList();
TabbedPanel tabbedPanel = new TabbedPanel<ITab>(ID_VIEWS_TAB_PANEL, tabs) {
private static final long serialVersionUID = 1L;
@Override
public TabbedPanel<ITab> setSelectedTab(int index) {
getRoleCatalogStorage().setDefaultTabIndex(index);
return super.setSelectedTab(index);
}
};
tabbedPanel.setOutputMarkupId(true);
int defaultSelectedTabIndex = getDefaultViewTypeIndex();
if (getRoleCatalogStorage().getDefaultTabIndex() > 0 && getRoleCatalogStorage().getDefaultTabIndex() < tabs.size()) {
tabbedPanel.setSelectedTab(getRoleCatalogStorage().getDefaultTabIndex());
} else if (defaultSelectedTabIndex < tabs.size()) {
tabbedPanel.setSelectedTab(defaultSelectedTabIndex);
}
mainForm.add(tabbedPanel);
}
use of com.evolveum.midpoint.web.component.TabbedPanel in project midpoint by Evolveum.
the class AbstractOrgTabPanel method initLayout.
private void initLayout() {
final IModel<List<ITab>> tabModel = new LoadableModel<>(true) {
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 final 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) {
OrgStructurePanelStorage usersStorage = getOrgStructurePanelStorage();
if (usersStorage != null) {
usersStorage.setSelectedTabId(tabId);
}
}
});
Panel panel = createTreePanel(panelId, new Model<>(oid), getPageBase());
panel.setOutputMarkupId(true);
return panel;
}
});
}
LOGGER.debug("Tab count is {}", tabs.size());
return tabs;
}
};
List<ITab> tabsList = tabModel.getObject();
OrgStructurePanelStorage orgStructurePanelStorage = getOrgStructurePanelStorage();
int selectedTab = 0;
if (orgStructurePanelStorage != null) {
selectedTab = orgStructurePanelStorage.getSelectedTabId() == -1 ? 0 : orgStructurePanelStorage.getSelectedTabId();
if (tabsList == null || (selectedTab > tabsList.size() - 1)) {
orgStructurePanelStorage.setSelectedTabId(0);
}
}
AjaxTabbedPanel<ITab> tabbedPanel = new AjaxTabbedPanel<>(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);
}
Aggregations