Search in sources :

Example 1 with ContainerPanelConfigurationType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType in project midpoint by Evolveum.

the class DetailsNavigationPanel method createDetailsSubNavigationPanel.

private DetailsNavigationPanel<O> createDetailsSubNavigationPanel(ListItem<ContainerPanelConfigurationType> item) {
    DetailsNavigationPanel<O> subPanel = new DetailsNavigationPanel<>(ID_SUB_NAVIGATION, objectDetailsModel, new PropertyModel<>(item.getModel(), ContainerPanelConfigurationType.F_PANEL.getLocalPart())) {

        @Override
        protected void onClickPerformed(ContainerPanelConfigurationType config, AjaxRequestTarget target) {
            if (config.getPath() == null) {
                config.setPath(item.getModelObject().getPath());
            }
            target.add(DetailsNavigationPanel.this);
            DetailsNavigationPanel.this.onClickPerformed(config, target);
        }
    };
    subPanel.add(new VisibleBehaviour(() -> !item.getModelObject().getPanel().isEmpty()));
    return subPanel;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) ContainerPanelConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType)

Example 2 with ContainerPanelConfigurationType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType in project midpoint by Evolveum.

the class DetailsNavigationPanel method getMenuItemIconClass.

private IModel<String> getMenuItemIconClass(IModel<ContainerPanelConfigurationType> item) {
    return new ReadOnlyModel<>(() -> {
        ContainerPanelConfigurationType config = item.getObject();
        if (config == null || config.getDisplay() == null) {
            return GuiStyleConstants.CLASS_CIRCLE_FULL;
        }
        String iconCss = WebComponentUtil.getIconCssClass(config.getDisplay());
        return StringUtils.isNoneEmpty(iconCss) ? iconCss : GuiStyleConstants.CLASS_CIRCLE_FULL;
    });
}
Also used : ReadOnlyModel(com.evolveum.midpoint.gui.api.model.ReadOnlyModel) ContainerPanelConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType)

Example 3 with ContainerPanelConfigurationType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType in project midpoint by Evolveum.

the class DetailsNavigationPanel method createNavigationDetailsStyleModel.

private IModel<String> createNavigationDetailsStyleModel(ListItem<ContainerPanelConfigurationType> item) {
    return new ReadOnlyModel<>(() -> {
        ContainerPanelConfigurationType storageConfig = getConfigurationFromStorage();
        ContainerPanelConfigurationType itemModelObject = item.getModelObject();
        if (isMenuActive(storageConfig, itemModelObject)) {
            return "active open";
        }
        if (hasActiveSubmenu(storageConfig, itemModelObject)) {
            return "open";
        }
        return "";
    });
}
Also used : ReadOnlyModel(com.evolveum.midpoint.gui.api.model.ReadOnlyModel) ContainerPanelConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType)

Example 4 with ContainerPanelConfigurationType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType in project midpoint by Evolveum.

the class DetailsNavigationPanel method getCounterProvider.

private SimpleCounter<ObjectDetailsModels<O>, O> getCounterProvider(IModel<ContainerPanelConfigurationType> panelModel) {
    ContainerPanelConfigurationType config = panelModel.getObject();
    String panelInstanceIdentifier = config.getIdentifier();
    SimpleCounter<ObjectDetailsModels<O>, O> counter = getPageBase().getCounterProvider(panelInstanceIdentifier);
    if (counter == null || counter.getClass().equals(SimpleCounter.class)) {
        return null;
    }
    return counter;
}
Also used : ObjectDetailsModels(com.evolveum.midpoint.gui.impl.page.admin.ObjectDetailsModels) SimpleCounter(com.evolveum.midpoint.web.application.SimpleCounter) ContainerPanelConfigurationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType)

Aggregations

ContainerPanelConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ContainerPanelConfigurationType)4 ReadOnlyModel (com.evolveum.midpoint.gui.api.model.ReadOnlyModel)2 ObjectDetailsModels (com.evolveum.midpoint.gui.impl.page.admin.ObjectDetailsModels)1 SimpleCounter (com.evolveum.midpoint.web.application.SimpleCounter)1 VisibleBehaviour (com.evolveum.midpoint.web.component.util.VisibleBehaviour)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1