use of com.evolveum.midpoint.web.component.TabbedPanel in project midpoint by Evolveum.
the class AssignmentPopup method createAddButton.
private AjaxButton createAddButton() {
AjaxButton addButton = new AjaxButton(ID_ASSIGN_BUTTON, createStringResource("userBrowserDialog.button.addButton")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
Map<String, AssignmentType> selectedAssignmentsMap = new HashMap<>();
TabbedPanel<ITab> panel = (TabbedPanel) AssignmentPopup.this.get(createComponentPath(ID_FORM, ID_TABS_PANEL));
panel.getTabs().getObject().forEach(panelTab -> {
WebMarkupContainer assignmentPanel = ((PanelTab) panelTab).getPanel();
if (assignmentPanel == null) {
return;
}
if (AbstractAssignmentPopupTabPanel.class.isAssignableFrom(assignmentPanel.getClass())) {
Map<String, AssignmentType> map = (((AbstractAssignmentPopupTabPanel) assignmentPanel).getSelectedAssignmentsMap());
map.forEach(selectedAssignmentsMap::putIfAbsent);
}
});
List<AssignmentType> assignments = new ArrayList<>(selectedAssignmentsMap.values());
getPageBase().hideMainPopup(target);
addPerformed(target, assignments);
}
};
addButton.add(AttributeAppender.append("title", getAddButtonTitleModel()));
addButton.add(new EnableBehaviour(this::isAssignButtonEnabled));
addButton.setOutputMarkupId(true);
return addButton;
}
use of com.evolveum.midpoint.web.component.TabbedPanel in project midpoint by Evolveum.
the class PageSystemConfiguration method createMainPanel.
@Override
protected AbstractObjectMainPanel<SystemConfigurationType> createMainPanel(String id) {
return new AbstractObjectMainPanel<SystemConfigurationType>(id, getObjectModel(), this) {
private static final long serialVersionUID = 1L;
@Override
protected List<ITab> createTabs(PageAdminObjectDetails<SystemConfigurationType> parentPage) {
return getTabs();
}
@Override
protected boolean getOptionsPanelVisibility() {
return false;
}
@Override
protected boolean isPreviewButtonVisible() {
return false;
}
@Override
protected void initLayoutTabs(PageAdminObjectDetails<SystemConfigurationType> parentPage) {
List<ITab> tabs = createTabs(parentPage);
TabbedPanel<ITab> tabPanel = new TabbedPanel<ITab>(ID_TAB_PANEL, tabs) {
private static final long serialVersionUID = 1L;
@Override
protected void onTabChange(int index) {
PageParameters params = getPageParameters();
params.set(SELECTED_TAB_INDEX, index);
parentPage.updateBreadcrumbParameters(SELECTED_TAB_INDEX, index);
}
};
getMainForm().add(tabPanel);
}
};
}
Aggregations