use of com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper in project midpoint by Evolveum.
the class AssignmentsDetailsPanel method createConditionTab.
private PanelTab createConditionTab() {
return new PanelTab(createStringResource("AssignmentType.condition")) {
@Override
public WebMarkupContainer createPanel(String panelId) {
return new SingleContainerPanel<>(panelId, PrismContainerWrapperModel.fromContainerValueWrapper(getModel(), AssignmentType.F_CONDITION), MappingType.COMPLEX_TYPE) {
@Override
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
ItemPath assignmentConditionExpressionPath = ItemPath.create(AssignmentHolderType.F_ASSIGNMENT, AssignmentType.F_CONDITION, MappingType.F_EXPRESSION);
ItemPath inducementConditionExpressionPath = ItemPath.create(AbstractRoleType.F_INDUCEMENT, AssignmentType.F_CONDITION, MappingType.F_EXPRESSION);
ItemPath itemPath = itemWrapper.getPath();
if (itemPath.namedSegmentsOnly().equivalent(assignmentConditionExpressionPath) || itemPath.namedSegmentsOnly().equivalent(inducementConditionExpressionPath)) {
return ItemVisibility.AUTO;
} else {
return ItemVisibility.HIDDEN;
}
}
};
}
};
}
use of com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper in project midpoint by Evolveum.
the class AssignmentConstructionPanel method initLayout.
private void initLayout() {
SingleContainerPanel<ConstructionType> baseConstructionPanel = new SingleContainerPanel<>(ID_BASIC, getModel(), ConstructionType.COMPLEX_TYPE) {
@Override
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
ItemPath itemPath = itemWrapper.getPath();
if (isAssociation(itemPath)) {
return ItemVisibility.HIDDEN;
}
if (isAttributePath(itemPath)) {
return ItemVisibility.HIDDEN;
}
if (ConstructionType.F_KIND.equivalent(itemPath.lastName())) {
return ItemVisibility.HIDDEN;
}
if (ConstructionType.F_INTENT.equivalent(itemPath.lastName())) {
return ItemVisibility.HIDDEN;
}
if (ConstructionType.F_RESOURCE_REF.equivalent(itemPath.lastName())) {
return ItemVisibility.HIDDEN;
}
return ItemVisibility.AUTO;
}
};
add(baseConstructionPanel);
ResourceAttributePanel attrsPanel = new ResourceAttributePanel(ID_ATTRIBUTES, PrismContainerWrapperModel.fromContainerWrapper(getModel(), ConstructionType.F_ATTRIBUTE), null);
add(attrsPanel);
}
use of com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper in project midpoint by Evolveum.
the class ResourceSchemaHandlingPanel method createMultivalueContainerDetailsPanel.
private MultivalueContainerDetailsPanel<ResourceObjectTypeDefinitionType> createMultivalueContainerDetailsPanel(String panelId, IModel<PrismContainerValueWrapper<ResourceObjectTypeDefinitionType>> model) {
return new MultivalueContainerDetailsPanel<>(panelId, model, true) {
@Override
protected ItemVisibility getBasicTabVisibity(ItemWrapper<?, ?> itemWrapper) {
if (itemWrapper instanceof PrismContainerWrapper) {
return ItemVisibility.HIDDEN;
}
return ItemVisibility.AUTO;
}
@Override
@NotNull
protected List<ITab> createTabs() {
List<ITab> tabs = new ArrayList<>();
tabs.add(new PanelTab(createStringResource("ResourceSchemaHandlingPanel.tab.attributes")) {
@Override
public WebMarkupContainer createPanel(String panelId) {
return new ResourceAttributePanel(panelId, PrismContainerWrapperModel.fromContainerValueWrapper(getModel(), ResourceObjectTypeDefinitionType.F_ATTRIBUTE), getPanelConfiguration());
}
});
return tabs;
}
@Override
protected DisplayNamePanel<ResourceObjectTypeDefinitionType> createDisplayNamePanel(String displayNamePanelId) {
return new DisplayNamePanel<>(displayNamePanelId, new ItemRealValueModel<>(getModel())) {
@Override
protected IModel<String> createHeaderModel() {
return new ReadOnlyModel<>(() -> loadHeaderModel(getModelObject()));
}
@Override
protected IModel<List<String>> getDescriptionLabelsModel() {
return new ReadOnlyModel<>(() -> loadDescriptionModel(getModelObject()));
}
};
}
};
}
use of com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper in project midpoint by Evolveum.
the class LoggingContentPanel method initLayout.
@Override
protected void initLayout() {
SingleContainerPanel panel = new SingleContainerPanel(ID_MAIN_PANEL, PrismContainerWrapperModel.fromContainerWrapper(getObjectWrapperModel(), ItemPath.create(SystemConfigurationType.F_LOGGING)), LoggingConfigurationType.COMPLEX_TYPE) {
@Override
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
ItemPath path = itemWrapper.getPath();
if (path == null || path.isEmpty()) {
return ItemVisibility.AUTO;
}
QName name;
if (path.size() == 1) {
name = path.firstToQName();
} else {
name = path.rest().firstToQName();
}
boolean hide = LoggingConfigurationType.F_CLASS_LOGGER.equals(name) || LoggingConfigurationType.F_SUB_SYSTEM_LOGGER.equals(name) || LoggingConfigurationType.F_APPENDER.equals(name);
return hide ? ItemVisibility.HIDDEN : ItemVisibility.AUTO;
}
};
add(panel);
}
use of com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper in project midpoint by Evolveum.
the class ReportCollectionParameterPanel method createDetailsPanelForParameter.
private MultivalueContainerDetailsPanel<SearchFilterParameterType> createDetailsPanelForParameter(ListItem<PrismContainerValueWrapper<SearchFilterParameterType>> item) {
return new MultivalueContainerDetailsPanel<>(MultivalueContainerListPanelWithDetailsPanel.ID_ITEM_DETAILS, item.getModel(), true) {
@Override
protected DisplayNamePanel<SearchFilterParameterType> createDisplayNamePanel(String displayNamePanelId) {
return new DisplayNamePanel<>(displayNamePanelId, new ItemRealValueModel<>(getModel())) {
@Override
protected IModel<String> createHeaderModel() {
return () -> {
SearchFilterParameterType parameter = getModelObject();
String name = parameter.getName();
if (parameter.getDisplay() != null && parameter.getDisplay().getLabel() != null) {
name = WebComponentUtil.getTranslatedPolyString(parameter.getDisplay().getLabel());
}
return name;
};
}
@Override
protected String createImageModel() {
return "fa fa-sliders";
}
};
}
@Override
protected ItemVisibility getBasicTabVisibity(ItemWrapper<?, ?> itemWrapper) {
if (ItemPath.create(itemWrapper.getParent().getPath(), SearchFilterParameterType.F_DISPLAY).equivalent(itemWrapper.getPath())) {
return ItemVisibility.HIDDEN;
}
return super.getBasicTabVisibity(itemWrapper);
}
@Override
@NotNull
protected List<ITab> createTabs() {
List<ITab> tabs = new ArrayList<>();
tabs.add(new PanelTab(createStringResource("SearchFilterParameterType.display")) {
@Override
public WebMarkupContainer createPanel(String panelId) {
return new SingleContainerPanel<>(panelId, PrismContainerWrapperModel.fromContainerValueWrapper(getModel(), SearchFilterParameterType.F_DISPLAY), DisplayType.COMPLEX_TYPE) {
@Override
protected ItemVisibility getVisibility(ItemWrapper itemWrapper) {
if (ItemPath.create(itemWrapper.getParent().getPath(), DisplayType.F_LABEL).equivalent(itemWrapper.getPath()) || ItemPath.create(itemWrapper.getParent().getPath(), DisplayType.F_HELP).equivalent(itemWrapper.getPath())) {
return super.getVisibility(itemWrapper);
}
return ItemVisibility.HIDDEN;
}
};
}
});
return tabs;
}
};
}
Aggregations