Search in sources :

Example 1 with PrismContainerWrapperColumn

use of com.evolveum.midpoint.gui.impl.component.data.column.PrismContainerWrapperColumn in project midpoint by Evolveum.

the class FocusProjectionsTabPanel method initBasicColumns.

private List<IColumn<PrismContainerValueWrapper<ShadowType>, String>> initBasicColumns() {
    IModel<PrismContainerDefinition<ShadowType>> shadowDef = Model.of(getShadowDefinition());
    List<IColumn<PrismContainerValueWrapper<ShadowType>, String>> columns = new ArrayList<>();
    columns.add(new CheckBoxHeaderColumn<>());
    columns.add(new CompositedIconColumn<PrismContainerValueWrapper<ShadowType>>(Model.of("")) {

        private static final long serialVersionUID = 1L;

        @Override
        protected CompositedIcon getCompositedIcon(IModel<PrismContainerValueWrapper<ShadowType>> rowModel) {
            if (rowModel == null || rowModel.getObject() == null || rowModel.getObject().getRealValue() == null) {
                return new CompositedIconBuilder().build();
            }
            ShadowType shadow = createShadowType(rowModel);
            return WebComponentUtil.createAccountIcon(shadow, getPageBase(), true);
        }
    });
    columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_NAME, ColumnType.LINK, getPageBase()) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void onClick(AjaxRequestTarget target, IModel<PrismContainerValueWrapper<ShadowType>> rowModel) {
            getMultivalueContainerListPanel().itemDetailsPerformed(target, rowModel);
            target.add(getFeedbackPanel());
        }
    });
    columns.add(new PrismReferenceWrapperColumn<>(shadowDef, ShadowType.F_RESOURCE_REF, ColumnType.STRING, getPageBase()));
    columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_OBJECT_CLASS, ColumnType.STRING, getPageBase()));
    columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_KIND, ColumnType.STRING, getPageBase()) {

        @Override
        public String getCssClass() {
            return "col-xs-1";
        }
    });
    columns.add(new PrismPropertyWrapperColumn<ShadowType, String>(shadowDef, ShadowType.F_INTENT, ColumnType.STRING, getPageBase()) {

        @Override
        public String getCssClass() {
            return "col-xs-1";
        }
    });
    columns.add(new PrismContainerWrapperColumn<ShadowType>(shadowDef, ShadowType.F_PENDING_OPERATION, getPageBase()) {

        @Override
        public String getCssClass() {
            return "col-xs-2";
        }

        @Override
        protected <IW extends ItemWrapper> Component createColumnPanel(String componentId, IModel<IW> rowModel) {
            IW object = rowModel.getObject();
            if (object == null) {
                return new WebMarkupContainer(componentId);
            }
            List<PrismValueWrapper<PendingOperationType>> values = object.getValues();
            List<PendingOperationType> pendingOperations = new ArrayList<>();
            values.forEach(value -> pendingOperations.add(value.getRealValue()));
            return new PendingOperationPanel(componentId, (IModel<List<PendingOperationType>>) () -> pendingOperations);
        }
    });
    columns.add(new InlineMenuButtonColumn(createShadowMenu(), getPageBase()) {

        @Override
        public String getCssClass() {
            return "col-xs-1";
        }
    });
    return columns;
}
Also used : Arrays(java.util.Arrays) VisibleBehaviour(com.evolveum.midpoint.web.component.util.VisibleBehaviour) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) PrismContainerWrapperColumn(com.evolveum.midpoint.gui.impl.component.data.column.PrismContainerWrapperColumn) CheckBoxHeaderColumn(com.evolveum.midpoint.web.component.data.column.CheckBoxHeaderColumn) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) ResourceSchemaFactory(com.evolveum.midpoint.schema.processor.ResourceSchemaFactory) DisplayableValue(com.evolveum.midpoint.util.DisplayableValue) ItemStatus(com.evolveum.midpoint.gui.api.prism.ItemStatus) ShadowPanel(com.evolveum.midpoint.gui.impl.prism.panel.ShadowPanel) WebModelServiceUtils(com.evolveum.midpoint.gui.api.util.WebModelServiceUtils) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ButtonInlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.ButtonInlineMenuItem) IModel(org.apache.wicket.model.IModel) PrismReferenceWrapperColumn(com.evolveum.midpoint.gui.impl.component.data.column.PrismReferenceWrapperColumn) com.evolveum.midpoint.prism(com.evolveum.midpoint.prism) ReadOnlyModel(com.evolveum.midpoint.gui.api.model.ReadOnlyModel) Label(org.apache.wicket.markup.html.basic.Label) PanelTab(com.evolveum.midpoint.gui.api.component.tabs.PanelTab) ListItem(org.apache.wicket.markup.html.list.ListItem) WrapperContext(com.evolveum.midpoint.gui.api.factory.wrapper.WrapperContext) CompositedIcon(com.evolveum.midpoint.gui.impl.component.icon.CompositedIcon) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel) Model(org.apache.wicket.model.Model) Component(org.apache.wicket.Component) ProjectionsListProvider(com.evolveum.midpoint.web.component.util.ProjectionsListProvider) WebComponentUtil(com.evolveum.midpoint.gui.api.util.WebComponentUtil) Task(com.evolveum.midpoint.task.api.Task) SessionStorage(com.evolveum.midpoint.web.session.SessionStorage) PageAdminFocus(com.evolveum.midpoint.web.page.admin.PageAdminFocus) MultivalueContainerListPanelWithDetailsPanel(com.evolveum.midpoint.gui.impl.component.MultivalueContainerListPanelWithDetailsPanel) List(java.util.List) ColumnMenuAction(com.evolveum.midpoint.web.component.data.column.ColumnMenuAction) DeleteConfirmationPanel(com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel) PropertyModel(org.apache.wicket.model.PropertyModel) PageBase(com.evolveum.midpoint.gui.api.page.PageBase) MultivalueContainerDetailsPanel(com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel) PrismObjectWrapperFactory(com.evolveum.midpoint.gui.api.factory.wrapper.PrismObjectWrapperFactory) QName(javax.xml.namespace.QName) PendingOperationPanel(com.evolveum.midpoint.gui.api.component.PendingOperationPanel) NotNull(org.jetbrains.annotations.NotNull) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel) DisplayNamePanel(com.evolveum.midpoint.gui.api.component.DisplayNamePanel) com.evolveum.midpoint.xml.ns._public.common.common_3(com.evolveum.midpoint.xml.ns._public.common.common_3) com.evolveum.midpoint.web.component.search(com.evolveum.midpoint.web.component.search) SchemaConstants(com.evolveum.midpoint.schema.constants.SchemaConstants) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) InlineMenuItemAction(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItemAction) BooleanUtils(org.apache.commons.lang3.BooleanUtils) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder) Trace(com.evolveum.midpoint.util.logging.Trace) UserProfileStorage(com.evolveum.midpoint.web.session.UserProfileStorage) ObjectFilter(com.evolveum.midpoint.prism.query.ObjectFilter) ArrayList(java.util.ArrayList) GuiStyleConstants(com.evolveum.midpoint.gui.api.GuiStyleConstants) PageStorage(com.evolveum.midpoint.web.session.PageStorage) ITab(org.apache.wicket.extensions.markup.html.tabs.ITab) InlineMenuItem(com.evolveum.midpoint.web.component.menu.cog.InlineMenuItem) TableId(com.evolveum.midpoint.web.session.UserProfileStorage.TableId) InlineMenuButtonColumn(com.evolveum.midpoint.web.component.data.column.InlineMenuButtonColumn) Popupable(com.evolveum.midpoint.web.component.dialog.Popupable) ProjectionDisplayNamePanel(com.evolveum.midpoint.gui.impl.component.ProjectionDisplayNamePanel) PrismPropertyWrapperColumn(com.evolveum.midpoint.gui.impl.component.data.column.PrismPropertyWrapperColumn) UserDtoStatus(com.evolveum.midpoint.web.page.admin.users.dto.UserDtoStatus) ResourceObjectTypeDefinition(com.evolveum.midpoint.schema.processor.ResourceObjectTypeDefinition) ColumnType(com.evolveum.midpoint.gui.impl.component.data.column.AbstractItemWrapperColumn.ColumnType) LoggingUtils(com.evolveum.midpoint.util.logging.LoggingUtils) ISelectableDataProvider(com.evolveum.midpoint.web.component.data.ISelectableDataProvider) Validate(org.apache.commons.lang3.Validate) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AssignmentObjectRelation(com.evolveum.midpoint.model.api.AssignmentObjectRelation) com.evolveum.midpoint.gui.api.prism.wrapper(com.evolveum.midpoint.gui.api.prism.wrapper) ResourceSchema(com.evolveum.midpoint.schema.processor.ResourceSchema) CompositedIconColumn(com.evolveum.midpoint.gui.impl.component.data.column.CompositedIconColumn) ObjectBrowserPanel(com.evolveum.midpoint.gui.api.component.ObjectBrowserPanel) TraceManager(com.evolveum.midpoint.util.logging.TraceManager) ArrayList(java.util.ArrayList) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) PendingOperationPanel(com.evolveum.midpoint.gui.api.component.PendingOperationPanel) CompositedIconBuilder(com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder) List(java.util.List) ArrayList(java.util.ArrayList) Component(org.apache.wicket.Component) IModel(org.apache.wicket.model.IModel) InlineMenuButtonColumn(com.evolveum.midpoint.web.component.data.column.InlineMenuButtonColumn) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) CompositedIcon(com.evolveum.midpoint.gui.impl.component.icon.CompositedIcon)

Aggregations

GuiStyleConstants (com.evolveum.midpoint.gui.api.GuiStyleConstants)1 DisplayNamePanel (com.evolveum.midpoint.gui.api.component.DisplayNamePanel)1 ObjectBrowserPanel (com.evolveum.midpoint.gui.api.component.ObjectBrowserPanel)1 PendingOperationPanel (com.evolveum.midpoint.gui.api.component.PendingOperationPanel)1 PanelTab (com.evolveum.midpoint.gui.api.component.tabs.PanelTab)1 PrismObjectWrapperFactory (com.evolveum.midpoint.gui.api.factory.wrapper.PrismObjectWrapperFactory)1 WrapperContext (com.evolveum.midpoint.gui.api.factory.wrapper.WrapperContext)1 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 ReadOnlyModel (com.evolveum.midpoint.gui.api.model.ReadOnlyModel)1 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 ItemStatus (com.evolveum.midpoint.gui.api.prism.ItemStatus)1 com.evolveum.midpoint.gui.api.prism.wrapper (com.evolveum.midpoint.gui.api.prism.wrapper)1 WebComponentUtil (com.evolveum.midpoint.gui.api.util.WebComponentUtil)1 WebModelServiceUtils (com.evolveum.midpoint.gui.api.util.WebModelServiceUtils)1 MultivalueContainerDetailsPanel (com.evolveum.midpoint.gui.impl.component.MultivalueContainerDetailsPanel)1 MultivalueContainerListPanelWithDetailsPanel (com.evolveum.midpoint.gui.impl.component.MultivalueContainerListPanelWithDetailsPanel)1 ProjectionDisplayNamePanel (com.evolveum.midpoint.gui.impl.component.ProjectionDisplayNamePanel)1 ColumnType (com.evolveum.midpoint.gui.impl.component.data.column.AbstractItemWrapperColumn.ColumnType)1 CompositedIconColumn (com.evolveum.midpoint.gui.impl.component.data.column.CompositedIconColumn)1 PrismContainerWrapperColumn (com.evolveum.midpoint.gui.impl.component.data.column.PrismContainerWrapperColumn)1