Search in sources :

Example 6 with AbstractTab

use of org.apache.wicket.extensions.markup.html.tabs.AbstractTab in project midpoint by Evolveum.

the class ConfigurationStep method updateConfigurationTabs.

private void updateConfigurationTabs() {
    final com.evolveum.midpoint.web.component.form.Form form = getForm();
    TabbedPanel<ITab> tabbedPanel = getConfigurationTabbedPanel();
    List<ITab> tabs = tabbedPanel.getTabs().getObject();
    tabs.clear();
    List<ContainerWrapper> wrappers = configurationPropertiesModel.getObject();
    for (final ContainerWrapper wrapper : wrappers) {
        String tabName = getString(wrapper.getDisplayName(), null, wrapper.getDisplayName());
        tabs.add(new AbstractTab(new Model<>(tabName)) {

            @Override
            public WebMarkupContainer getPanel(String panelId) {
                return new PrismContainerPanel(panelId, new Model<>(wrapper), true, form, parentPage);
            }
        });
    }
    int i = tabbedPanel.getSelectedTab();
    if (i < 0 || i > tabs.size()) {
        i = 0;
    }
    tabbedPanel.setSelectedTab(i);
}
Also used : ContainerWrapper(com.evolveum.midpoint.web.component.prism.ContainerWrapper) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) ListModel(org.apache.wicket.model.util.ListModel) Model(org.apache.wicket.model.Model) NonEmptyLoadableModel(com.evolveum.midpoint.gui.api.model.NonEmptyLoadableModel) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab) PrismContainerPanel(com.evolveum.midpoint.web.component.prism.PrismContainerPanel)

Example 7 with AbstractTab

use of org.apache.wicket.extensions.markup.html.tabs.AbstractTab in project midpoint by Evolveum.

the class PageReport method initLayout.

private void initLayout() {
    Form mainForm = new Form(ID_MAIN_FORM);
    add(mainForm);
    List<ITab> tabs = new ArrayList<>();
    tabs.add(new AbstractTab(createStringResource("PageReport.basic")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new ReportConfigurationPanel(panelId, model);
        }
    });
    tabs.add(new AbstractTab(createStringResource("PageReport.jasperTemplate")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new JasperReportConfigurationPanel(panelId, model);
        //                IModel<String> title = PageReport.this.createStringResource("PageReport.jasperTemplate");
        //                IModel<String> data = new Base64Model(new PrismPropertyModel<>(model, ReportType.F_TEMPLATE));
        //                return new AceEditorPanel(panelId, title, data);
        }
    });
    tabs.add(new AbstractTab(createStringResource("PageReport.jasperTemplateStyle")) {

        private static final long serialVersionUID = 1L;

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            IModel<String> title = PageReport.this.createStringResource("PageReport.jasperTemplateStyle");
            IModel<String> data = new Base64Model(new PropertyModel(model, "templateStyle"));
            return new AceEditorPanel(panelId, title, data);
        }
    });
    //        tabs.add(new AbstractTab(createStringResource("PageReport.fullXml")) {
    //
    //            @Override
    //            public WebMarkupContainer getPanel(String panelId) {
    //                IModel<String> title = PageReport.this.createStringResource("PageReport.fullXml");
    //
    //                AceEditorPanel panel = new AceEditorPanel(panelId, title, createFullXmlModel());
    //                panel.getEditor().add(createFullXmlValidator());
    //                return panel;
    //            }
    //        });
    TabbedPanel<ITab> reportTabPanel = WebComponentUtil.createTabPanel(ID_TAB_PANEL, this, tabs, null);
    reportTabPanel.setOutputMarkupId(true);
    mainForm.add(reportTabPanel);
    initButtons(mainForm);
}
Also used : IModel(org.apache.wicket.model.IModel) JasperReportConfigurationPanel(com.evolveum.midpoint.web.page.admin.reports.component.JasperReportConfigurationPanel) ReportConfigurationPanel(com.evolveum.midpoint.web.page.admin.reports.component.ReportConfigurationPanel) Form(org.apache.wicket.markup.html.form.Form) AceEditorPanel(com.evolveum.midpoint.web.page.admin.reports.component.AceEditorPanel) Base64Model(com.evolveum.midpoint.web.util.Base64Model) ArrayList(java.util.ArrayList) PropertyModel(org.apache.wicket.model.PropertyModel) JasperReportConfigurationPanel(com.evolveum.midpoint.web.page.admin.reports.component.JasperReportConfigurationPanel) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab)

Example 8 with AbstractTab

use of org.apache.wicket.extensions.markup.html.tabs.AbstractTab in project midpoint by Evolveum.

the class PageSystemConfiguration method initLayout.

private void initLayout() {
    Form mainForm = new Form(ID_MAIN_FORM, true);
    add(mainForm);
    List<ITab> tabs = new ArrayList<>();
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.system.title")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            systemConfigPanel = new SystemConfigPanel(panelId, model);
            return systemConfigPanel;
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.notifications.title")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            notificationConfigPanel = new NotificationConfigPanel(panelId, new PropertyModel<NotificationConfigurationDto>(model, "notificationConfig"));
            return notificationConfigPanel;
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.logging.title")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            loggingConfigPanel = new LoggingConfigPanel(panelId, new PropertyModel<LoggingDto>(model, "loggingConfig"));
            return loggingConfigPanel;
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.profiling.title")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            profilingConfigPanel = new ProfilingConfigPanel(panelId, new PropertyModel<ProfilingDto>(model, "profilingDto"), PageSystemConfiguration.this);
            return profilingConfigPanel;
        }
    });
    tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.adminGui.title")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            adminGuiConfigPanel = new AdminGuiConfigPanel(panelId, model);
            return adminGuiConfigPanel;
        }
    });
    TabbedPanel tabPanel = new TabbedPanel(ID_TAB_PANEL, tabs) {

        @Override
        protected void onTabChange(int index) {
            PageParameters params = getPageParameters();
            params.set(SELECTED_TAB_INDEX, index);
        }
    };
    tabPanel.setOutputMarkupId(true);
    mainForm.add(tabPanel);
    initButtons(mainForm);
}
Also used : Form(com.evolveum.midpoint.web.component.form.Form) ArrayList(java.util.ArrayList) TabbedPanel(com.evolveum.midpoint.web.component.TabbedPanel) PageParameters(org.apache.wicket.request.mapper.parameter.PageParameters) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab)

Example 9 with AbstractTab

use of org.apache.wicket.extensions.markup.html.tabs.AbstractTab in project midpoint by Evolveum.

the class TaskMainPanel method createTabs.

protected List<ITab> createTabs() {
    List<ITab> tabs = new ArrayList<>();
    final TaskTabsVisibility visibility = new TaskTabsVisibility();
    tabs.add(new AbstractTab(parentPage.createStringResource("pageTaskEdit.basic")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new TaskBasicTabPanel(panelId, getMainForm(), objectModel, taskDtoModel, parentPage);
        }

        @Override
        public boolean isVisible() {
            return visibility.computeBasicVisible(parentPage);
        }
    });
    tabs.add(new AbstractTab(parentPage.createStringResource("pageTaskEdit.scheduleTitle")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new TaskSchedulingTabPanel(panelId, getMainForm(), objectModel, taskDtoModel, parentPage);
        }

        @Override
        public boolean isVisible() {
            return visibility.computeSchedulingVisible(parentPage);
        }
    });
    tabs.add(new AbstractTab(parentPage.createStringResource("pageTaskEdit.subtasksAndThreads")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new TaskSubtasksAndThreadsTabPanel(panelId, getMainForm(), objectModel, taskDtoModel, parentPage);
        }

        @Override
        public boolean isVisible() {
            return visibility.computeSubtasksAndThreadsVisible(parentPage);
        }
    });
    tabs.add(new AbstractTab(parentPage.createStringResource("pageTaskEdit.progress")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new TaskProgressTabPanel(panelId, getMainForm(), objectModel, taskDtoModel, parentPage);
        }

        @Override
        public boolean isVisible() {
            return visibility.computeProgressVisible(parentPage);
        }
    });
    tabs.add(new AbstractTab(parentPage.createStringResource("pageTaskEdit.performance")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new TaskPerformanceTabPanel(panelId, getMainForm(), objectModel, taskDtoModel, parentPage);
        }

        @Override
        public boolean isVisible() {
            return visibility.computeEnvironmentalPerformanceVisible(parentPage);
        }
    });
    tabs.add(new AbstractTab(parentPage.createStringResource("pageTaskEdit.approvals")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new TaskApprovalsTabPanel(panelId, getMainForm(), objectModel, taskDtoModel, parentPage);
        }

        @Override
        public boolean isVisible() {
            return visibility.computeApprovalsVisible(parentPage);
        }
    });
    tabs.add(new AbstractTab(parentPage.createStringResource("pageTaskEdit.operation")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new TaskOperationTabPanel(panelId, getMainForm(), objectModel, taskDtoModel, parentPage);
        }

        @Override
        public boolean isVisible() {
            return visibility.computeOperationVisible(parentPage);
        }
    });
    tabs.add(new AbstractTab(parentPage.createStringResource("pageTaskEdit.result")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new TaskResultTabPanel(panelId, getMainForm(), objectModel, taskDtoModel, parentPage);
        }

        @Override
        public boolean isVisible() {
            return visibility.computeResultVisible(parentPage);
        }
    });
    tabs.add(new AbstractTab(parentPage.createStringResource("pageTaskEdit.errors")) {

        @Override
        public WebMarkupContainer getPanel(String panelId) {
            return new TaskErrorsTabPanel(panelId, getMainForm(), objectModel, taskDtoModel, parentPage);
        }

        @Override
        public boolean isVisible() {
            return visibility.computeErrorsVisible(parentPage);
        }
    });
    return tabs;
}
Also used : ArrayList(java.util.ArrayList) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AbstractTab(org.apache.wicket.extensions.markup.html.tabs.AbstractTab)

Aggregations

AbstractTab (org.apache.wicket.extensions.markup.html.tabs.AbstractTab)9 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)8 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)8 ArrayList (java.util.ArrayList)6 TabbedPanel (com.evolveum.midpoint.web.component.TabbedPanel)4 List (java.util.List)2 Form (org.apache.wicket.markup.html.form.Form)2 IModel (org.apache.wicket.model.IModel)2 Model (org.apache.wicket.model.Model)2 PropertyModel (org.apache.wicket.model.PropertyModel)2 BasePanel (com.evolveum.midpoint.gui.api.component.BasePanel)1 CountablePanelTab (com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab)1 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 NonEmptyLoadableModel (com.evolveum.midpoint.gui.api.model.NonEmptyLoadableModel)1 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)1 AceEditor (com.evolveum.midpoint.web.component.AceEditor)1 AjaxTabbedPanel (com.evolveum.midpoint.web.component.AjaxTabbedPanel)1 Form (com.evolveum.midpoint.web.component.form.Form)1 ContainerWrapper (com.evolveum.midpoint.web.component.prism.ContainerWrapper)1 PrismContainerPanel (com.evolveum.midpoint.web.component.prism.PrismContainerPanel)1