Search in sources :

Example 21 with DisplayType

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

the class GenericSupport method getLabel.

static <C extends Containerable> String getLabel(GuiObjectColumnType column, PrismContainerDefinition<C> objectDefinition, LocalizationService localizationService) {
    ItemPath path = column.getPath() == null ? null : column.getPath().getItemPath();
    DisplayType columnDisplay = column.getDisplay();
    String label;
    if (columnDisplay != null && columnDisplay.getLabel() != null) {
        label = getMessage(localizationService, columnDisplay.getLabel().getOrig());
    } else {
        String name = column.getName();
        String displayName = null;
        if (path != null) {
            ItemDefinition<Item<?, ?>> def = objectDefinition.findItemDefinition(path);
            if (def == null) {
                throw new IllegalArgumentException("Could'n find item for path " + path);
            }
            displayName = def.getDisplayName();
        }
        if (StringUtils.isNotEmpty(displayName)) {
            label = getMessage(localizationService, displayName);
        } else {
            label = name;
        }
    }
    return label;
}
Also used : DisplayType(com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType) ItemPath(com.evolveum.midpoint.prism.path.ItemPath)

Aggregations

DisplayType (com.evolveum.midpoint.xml.ns._public.common.common_3.DisplayType)18 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)6 Label (org.apache.wicket.markup.html.basic.Label)5 ReadOnlyModel (com.evolveum.midpoint.gui.api.model.ReadOnlyModel)4 CompositedIconBuilder (com.evolveum.midpoint.gui.impl.component.icon.CompositedIconBuilder)4 ICellPopulator (org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator)4 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)4 PrismReferenceValue (com.evolveum.midpoint.prism.PrismReferenceValue)3 TooltipBehavior (com.evolveum.midpoint.web.util.TooltipBehavior)3 IModel (org.apache.wicket.model.IModel)3 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)2 CompositedIconPanel (com.evolveum.midpoint.gui.impl.component.data.column.CompositedIconPanel)2 StringLimitationResult (com.evolveum.midpoint.model.api.validator.StringLimitationResult)2 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)2 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2 CompositedIconButtonDto (com.evolveum.midpoint.web.component.CompositedIconButtonDto)2 TablePanel (com.evolveum.midpoint.web.component.data.TablePanel)2 ImagePanel (com.evolveum.midpoint.web.component.data.column.ImagePanel)2 EnableBehaviour (com.evolveum.midpoint.web.component.util.EnableBehaviour)2 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)2