Package org.ametys.runtime.model
Interface ViewItemAccessor
- All Known Subinterfaces:
ViewItemContainer
,ViewItemGroup
- All Known Implementing Classes:
AbstractViewItemGroup
,ModelViewItemGroup
,SimpleViewItemGroup
,View
,ViewElementAccessor
public interface ViewItemAccessor
Interface for objects that can access to some view items
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addViewItem
(ViewItem item) Add a view item in the accessordefault void
addViewItems
(List<ViewItem> items) Add view items in the accessorvoid
clear()
Removes all items of this accessordefault ModelViewItem
getModelViewItem
(String itemName) Retrieves the model view item with the given name If there are more than one corresponding items, the first one is retrieveddefault ViewItem
getViewItem
(String itemName) Retrieves the view item with the given name If there are more than one corresponding items, the first one is retrievedRetrieves all the view items of this accessordefault boolean
hasModelViewItem
(String itemName) Checks if there is a model view item with the given namedefault boolean
Checks if the currentViewItemAccessor
contains the given model view item Consider that the accessor contains the given item if it contains an item representing the same definitiondefault boolean
hasModelViewItem
(ModelViewItem item, String currentAccessorPath, String itemPath) Checks if the currentViewItemAccessor
contains the given model view item Consider that the accessor contains the given item if it contains an item representing the same definition AND with the same children if it is a group AND at the same position as the given pathvoid
insertViewItem
(ViewItem item, int index) Insert a view item in the accessor at the given indexboolean
removeViewItem
(ViewItem item) Removes the given items of this accessor
-
Method Details
-
getViewItems
Retrieves all the view items of this accessor- Returns:
- the view items
-
addViewItem
Add a view item in the accessor- Parameters:
item
- the item to add
-
insertViewItem
Insert a view item in the accessor at the given index- Parameters:
item
- the item to insertindex
- index at which the item has to be inserted
-
removeViewItem
Removes the given items of this accessor- Parameters:
item
- the item to remove- Returns:
true
if this accessor contained the given item,false
otherwise
-
clear
void clear()Removes all items of this accessor -
addViewItems
Add view items in the accessor- Parameters:
items
- the items to add
-
hasModelViewItem
Checks if the currentViewItemAccessor
contains the given model view item Consider that the accessor contains the given item if it contains an item representing the same definition- Parameters:
item
- the item- Returns:
true
if the accessor contains the given item,false
otherwise
-
hasModelViewItem
Checks if the currentViewItemAccessor
contains the given model view item Consider that the accessor contains the given item if it contains an item representing the same definition AND with the same children if it is a group AND at the same position as the given path- Parameters:
item
- the itemcurrentAccessorPath
- The path of the current item accessoritemPath
- the path of the item in the accessor- Returns:
true
if the accessor contains the given item,false
otherwise
-
hasModelViewItem
Checks if there is a model view item with the given name- Parameters:
itemName
- the name of the item- Returns:
true
if the accessor can access to an item with the given name,false
otherwise
-
getModelViewItem
Retrieves the model view item with the given name If there are more than one corresponding items, the first one is retrieved- Parameters:
itemName
- the name of the item- Returns:
- the model view item, or
null
if none was found
-
getViewItem
Retrieves the view item with the given name If there are more than one corresponding items, the first one is retrieved- Parameters:
itemName
- the name of the item- Returns:
- the view item, or
null
if none was found
-