Search in sources :

Example 11 with TabbedPanel

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;
}
Also used : PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) CountablePanelTab(com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab) TabbedPanel(com.evolveum.midpoint.web.component.TabbedPanel) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) EnableBehaviour(com.evolveum.midpoint.web.component.util.EnableBehaviour)

Example 12 with TabbedPanel

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);
        }
    };
}
Also used : AbstractObjectMainPanel(com.evolveum.midpoint.web.component.objectdetails.AbstractObjectMainPanel) TabbedPanel(com.evolveum.midpoint.web.component.TabbedPanel) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) PageAdminObjectDetails(com.evolveum.midpoint.web.page.admin.PageAdminObjectDetails) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab)

Aggregations

TabbedPanel (com.evolveum.midpoint.web.component.TabbedPanel)12 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)11 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)6 ArrayList (java.util.ArrayList)5 AbstractTab (org.apache.wicket.extensions.markup.html.tabs.AbstractTab)5 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)4 CountablePanelTab (com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab)2 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)2 List (java.util.List)2 PageParameters (org.apache.wicket.request.mapper.parameter.PageParameters)2 BasePanel (com.evolveum.midpoint.gui.api.component.BasePanel)1 PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)1 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 AjaxTabbedPanel (com.evolveum.midpoint.web.component.AjaxTabbedPanel)1 Form (com.evolveum.midpoint.web.component.form.Form)1 MidpointForm (com.evolveum.midpoint.web.component.form.MidpointForm)1 AbstractObjectMainPanel (com.evolveum.midpoint.web.component.objectdetails.AbstractObjectMainPanel)1