Package org.ametys.runtime.model
Class ViewElementAccessor
java.lang.Object
org.ametys.runtime.model.ViewElement
org.ametys.runtime.model.ViewElementAccessor
- All Implemented Interfaces:
ModelViewItem<ElementDefinition>,ViewItem,ViewItemAccessor,Labelable,ModifiableLabelable
- Direct Known Subclasses:
ViewElementAccessorSearchUIColumn
View element that can access to other view items
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddViewItem(ViewItem item) Add a view item in the accessorvoidclear()Removes all items of this accessorvoidcopyTo(ViewItem item, ViewItemAccessor referenceViewItemAccessor, String itemPath) Copy the current view item in the given one.Create an instance ofViewItembooleanRetrieves all the view items of this accessorinthashCode()voidinsertViewItem(ViewItem item, int index) Insert a view item in the accessor at the given indexstatic ViewElementAccessorof(ModelItemAccessor modelItemAccessor) Creates aViewElementAccessorwith the items of the givenModelItemAccessorstatic ViewElementAccessorof(ModelItemAccessor modelItemAccessor, String... itemPaths) Creates aViewElementAccessorwith the given itemsbooleanremoveViewItem(ViewItem item) Removes the given items of this accessortoString()Methods inherited from class org.ametys.runtime.model.ViewElement
copyTo, equals, getDefinition, getDescription, getLabel, getName, getParent, setDefinition, setDescription, setLabel, setParent, toJSON, toSAXMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ametys.runtime.model.ModelViewItem
setNameMethods inherited from interface org.ametys.runtime.model.ViewItemAccessor
addViewItems, getModelViewItem, getViewItem, hasModelViewItem, hasModelViewItem, hasModelViewItem
-
Constructor Details
-
ViewElementAccessor
public ViewElementAccessor()
-
-
Method Details
-
getViewItems
Description copied from interface:ViewItemAccessorRetrieves all the view items of this accessor- Specified by:
getViewItemsin interfaceViewItemAccessor- Returns:
- the view items
-
addViewItem
Description copied from interface:ViewItemAccessorAdd a view item in the accessor- Specified by:
addViewItemin interfaceViewItemAccessor- Parameters:
item- the item to add
-
insertViewItem
Description copied from interface:ViewItemAccessorInsert a view item in the accessor at the given index- Specified by:
insertViewItemin interfaceViewItemAccessor- Parameters:
item- the item to insertindex- index at which the item has to be inserted
-
removeViewItem
Description copied from interface:ViewItemAccessorRemoves the given items of this accessor- Specified by:
removeViewItemin interfaceViewItemAccessor- Parameters:
item- the item to remove- Returns:
trueif this accessor contained the given item,falseotherwise
-
clear
Description copied from interface:ViewItemAccessorRemoves all items of this accessor- Specified by:
clearin interfaceViewItemAccessor
-
of
public static ViewElementAccessor of(ModelItemAccessor modelItemAccessor) throws IllegalArgumentException Creates aViewElementAccessorwith the items of the givenModelItemAccessor- Parameters:
modelItemAccessor- the model item accessor- Returns:
- the created
ViewElementAccessor - Throws:
IllegalArgumentException- if the model item accessor isnull
-
of
public static ViewElementAccessor of(ModelItemAccessor modelItemAccessor, String... itemPaths) throws IllegalArgumentException, BadItemTypeException Creates aViewElementAccessorwith the given items- Parameters:
modelItemAccessor- the model item accessing the items definitionsitemPaths- the paths of the items to put in the view item- Returns:
- the created
ViewElementAccessor - Throws:
IllegalArgumentException- if the model item accessor isnullor if an item path isnull, empty, or is not defined in the given model itemsBadItemTypeException- if a segment in a path (but not the last) does not represent a group item
-
copyTo
Description copied from interface:ViewItemCopy the current view item in the given one. If the view item is an accessor, its view items are copied only if they are not already present in the referenceViewItemAccessor- Specified by:
copyToin interfaceViewItem- Parameters:
item- the copyreferenceViewItemAccessor- the referenceViewItemAccessoritemPath- the path of the view item relative to the referenceViewItemAccessor
-
createInstance
Description copied from interface:ViewItemCreate an instance ofViewItem- Specified by:
createInstancein interfaceViewItem- Overrides:
createInstancein classViewElement- Returns:
- the created instance
-
hashCode
- Overrides:
hashCodein classViewElement
-
equals
- Overrides:
equalsin classViewElement
-
toString
- Overrides:
toStringin classViewElement
-