Search in sources :

Example 71 with Panel

use of org.apache.wicket.markup.html.panel.Panel in project midpoint by Evolveum.

the class PageBase method initItemPanel.

public <IW extends ItemWrapper> Panel initItemPanel(String panelId, QName typeName, IModel<IW> wrapperModel, ItemPanelSettings itemPanelSettings) throws SchemaException {
    Class<?> panelClass = getWrapperPanel(typeName);
    if (panelClass == null) {
        ErrorPanel errorPanel = new ErrorPanel(panelId, () -> "Cannot create panel for " + typeName);
        errorPanel.add(new VisibleBehaviour(() -> getApplication().usesDevelopmentConfig()));
        return errorPanel;
    }
    Constructor<?> constructor;
    try {
        constructor = panelClass.getConstructor(String.class, IModel.class, ItemPanelSettings.class);
        return (Panel) constructor.newInstance(panelId, wrapperModel, itemPanelSettings);
    } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
        throw new SystemException("Cannot instantiate " + panelClass, e);
    }
}
Also used : ErrorPanel(com.evolveum.midpoint.gui.impl.error.ErrorPanel) IModel(org.apache.wicket.model.IModel) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) PolyString(com.evolveum.midpoint.prism.polystring.PolyString) InvocationTargetException(java.lang.reflect.InvocationTargetException) ItemPanelSettings(com.evolveum.midpoint.gui.impl.prism.panel.ItemPanelSettings) LocalePanel(com.evolveum.midpoint.web.component.menu.top.LocalePanel) UserMenuPanel(com.evolveum.midpoint.web.component.menu.UserMenuPanel) ErrorPanel(com.evolveum.midpoint.gui.impl.error.ErrorPanel) PrismContainerValuePanel(com.evolveum.midpoint.gui.impl.prism.panel.PrismContainerValuePanel) Panel(org.apache.wicket.markup.html.panel.Panel) LeftMenuPanel(com.evolveum.midpoint.gui.impl.component.menu.LeftMenuPanel)

Example 72 with Panel

use of org.apache.wicket.markup.html.panel.Panel in project midpoint by Evolveum.

the class ProfilingConfigurationTabPanel method initLayout.

protected void initLayout() {
    WebMarkupContainer profilingEnabledNote = new WebMarkupContainer(ID_PROFILING_ENABLED_NOTE);
    profilingEnabledNote.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return getPageBase().getMidpointConfiguration().getProfilingMode() == ProfilingMode.OFF;
        }
    });
    add(profilingEnabledNote);
    try {
        ItemPanelSettingsBuilder builder = new ItemPanelSettingsBuilder();
        Panel panel = getPageBase().initItemPanel(ID_PROFILING, ProfilingConfigurationType.COMPLEX_TYPE, getProfilingModel(), builder.build());
        add(panel);
    } catch (SchemaException e) {
        LOGGER.error("Cannot create profiling panel. Reason: {}", e.getMessage(), e);
        getSession().error("Cannot create profiling panel.");
    }
    PrismContainerWrapperModel<LoggingConfigurationType, ClassLoggerConfigurationType> profilingLogger = PrismContainerWrapperModel.fromContainerWrapper(getLoggingModel(), ItemPath.create(ProfilingClassLoggerWrapperFactoryImpl.PROFILING_LOGGER_PATH));
    try {
        ItemPanelSettingsBuilder builder = new ItemPanelSettingsBuilder();
        Panel logger = getPageBase().initItemPanel(ID_PROFILING_LOGGER, ProfilingClassLoggerWrapperFactoryImpl.PROFILING_LOGGER_PATH, profilingLogger, builder.build());
        add(logger);
    } catch (SchemaException e) {
        LOGGER.error("Cannot create profiling panel. Reason: {}", e.getMessage(), e);
        getSession().error("Cannot create profiling panel.");
    }
}
Also used : ItemPanelSettingsBuilder(com.evolveum.midpoint.gui.impl.prism.panel.ItemPanelSettingsBuilder) ItemHeaderPanel(com.evolveum.midpoint.gui.impl.prism.panel.ItemHeaderPanel) Panel(org.apache.wicket.markup.html.panel.Panel) BasePanel(com.evolveum.midpoint.gui.api.component.BasePanel) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) LoggingConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.LoggingConfigurationType) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) ClassLoggerConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ClassLoggerConfigurationType) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 73 with Panel

use of org.apache.wicket.markup.html.panel.Panel in project midpoint by Evolveum.

the class SystemConfigPanel method initLayout.

protected void initLayout() {
    try {
        ItemPanelSettingsBuilder builder = new ItemPanelSettingsBuilder().visibilityHandler(this::getBasicTabVisibity);
        Panel panel = getPageBase().initItemPanel(ID_SYSTEM_CONFIG, SystemConfigurationType.COMPLEX_TYPE, getModel(), builder.build());
        add(panel);
    } catch (SchemaException e) {
        LOGGER.error("Cannot create basic panel for system configuration.");
        getSession().error("Cannot create basic panel for system configuration.");
    }
}
Also used : ItemPanelSettingsBuilder(com.evolveum.midpoint.gui.impl.prism.panel.ItemPanelSettingsBuilder) ItemHeaderPanel(com.evolveum.midpoint.gui.impl.prism.panel.ItemHeaderPanel) Panel(org.apache.wicket.markup.html.panel.Panel) BasePanel(com.evolveum.midpoint.gui.api.component.BasePanel) SchemaException(com.evolveum.midpoint.util.exception.SchemaException)

Example 74 with Panel

use of org.apache.wicket.markup.html.panel.Panel in project midpoint by Evolveum.

the class ReportCollectionViewPanel method initLayout.

@Override
protected void initLayout() {
    PrismPropertyWrapperModel<ReportType, Object> propertyModel = PrismPropertyWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(ReportType.F_OBJECT_COLLECTION, ObjectCollectionReportEngineConfigurationType.F_VIEW, GuiObjectListViewType.F_TYPE));
    try {
        Panel propertyPanel = getPageBase().initItemPanel(ID_TYPE, propertyModel.getObject().getTypeName(), propertyModel, null);
        add(propertyPanel);
    } catch (SchemaException e) {
        LOGGER.error("Couldn't create panel for type element in view");
    }
    add(createObjectListForColumns());
}
Also used : AbstractObjectMainPanel(com.evolveum.midpoint.gui.impl.page.admin.AbstractObjectMainPanel) DisplayNamePanel(com.evolveum.midpoint.gui.api.component.DisplayNamePanel) BasicMultivalueContainerListPanel(com.evolveum.midpoint.gui.impl.component.BasicMultivalueContainerListPanel) MultivalueContainerListPanelWithDetailsPanel(com.evolveum.midpoint.gui.impl.component.MultivalueContainerListPanelWithDetailsPanel) Panel(org.apache.wicket.markup.html.panel.Panel) MultivalueContainerDetailsPanel(com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel) SchemaException(com.evolveum.midpoint.util.exception.SchemaException)

Example 75 with Panel

use of org.apache.wicket.markup.html.panel.Panel in project midpoint by Evolveum.

the class AssignmentHolderTypeDetailsTabPanel method initLayout.

private void initLayout() {
    try {
        ItemPanelSettingsBuilder builder = new ItemPanelSettingsBuilder().visibilityHandler(w -> ItemVisibility.AUTO);
        builder.headerVisibility(false);
        Panel main = getPageBase().initItemPanel(ID_MAIN_PANEL, getObjectWrapper().getTypeName(), PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.EMPTY_PATH), builder.build());
        add(main);
        Panel activation = getPageBase().initItemPanel(ID_ACTIVATION_PANEL, ActivationType.COMPLEX_TYPE, PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), FocusType.F_ACTIVATION), builder.build());
        add(activation);
        Panel password = getPageBase().initItemPanel(ID_PASSWORD_PANEL, PasswordType.COMPLEX_TYPE, PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(UserType.F_CREDENTIALS, CredentialsType.F_PASSWORD)), builder.build());
        add(password);
    } catch (SchemaException e) {
        LOGGER.error("Could not create focus details panel. Reason: {}", e.getMessage(), e);
    }
}
Also used : ItemPanelSettingsBuilder(com.evolveum.midpoint.gui.impl.prism.panel.ItemPanelSettingsBuilder) Panel(org.apache.wicket.markup.html.panel.Panel) RefreshableTabPanel(com.evolveum.midpoint.web.page.admin.server.RefreshableTabPanel) SchemaException(com.evolveum.midpoint.util.exception.SchemaException)

Aggregations

Panel (org.apache.wicket.markup.html.panel.Panel)76 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)27 ArrayList (java.util.ArrayList)21 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)18 BasePanel (com.evolveum.midpoint.gui.api.component.BasePanel)16 ITab (org.apache.wicket.extensions.markup.html.tabs.ITab)16 Before (org.junit.Before)16 AbstractTab (org.apache.wicket.extensions.markup.html.tabs.AbstractTab)15 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)13 AjaxBootstrapTabbedPanel (de.agilecoders.wicket.core.markup.html.bootstrap.tabs.AjaxBootstrapTabbedPanel)12 ResourceModel (org.apache.wicket.model.ResourceModel)11 DivTestPanel (org.odlabs.wiquery.ui.DivTestPanel)11 ItemPanelSettingsBuilder (com.evolveum.midpoint.gui.impl.prism.panel.ItemPanelSettingsBuilder)10 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)10 List (java.util.List)9 Test (org.junit.Test)9 IModel (org.apache.wicket.model.IModel)8 Model (org.apache.wicket.model.Model)6 ActionsPanel (org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel)5 Label (org.apache.wicket.markup.html.basic.Label)5