Package org.ametys.runtime.model
Class ModelViewItemGroup<T extends ModelItemGroup>
java.lang.Object
org.ametys.runtime.model.AbstractViewItemGroup
org.ametys.runtime.model.ModelViewItemGroup<T>
- Type Parameters:
T- type of the referenced model item group
- All Implemented Interfaces:
ModelViewItem<T>,ViewItem,ViewItemAccessor,ViewItemContainer,ViewItemGroup,Labelable,ModifiableLabelable
- Direct Known Subclasses:
RepeaterViewItem
public class ModelViewItemGroup<T extends ModelItemGroup>
extends AbstractViewItemGroup
implements ModelViewItem<T>
View reference to a group of model items
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.runtime.model.ModelViewItem
ModelViewItem.DisabledItemRendering -
Field Summary
Fields inherited from class org.ametys.runtime.model.AbstractViewItemGroup
_children, _description, _label, _roleFields inherited from interface org.ametys.runtime.model.ModelViewItem
DEFAULT_ITEM_TAG_NAMEFields inherited from interface org.ametys.runtime.model.ViewItemGroup
FIELDSET_ROLE, TAB_ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription_childrenToJSON(DefinitionContext context) Converts the group's children in a JSON mapprotected voidadditionalDataToSAX(ContentHandler contentHandler, DefinitionContext context) Permit to generate SAX events for additional data in sub classesvoidCopy the current view item in the given one.Create an instance ofViewItembooleanRetrieves the referenced model item definitionRetrieves the description.Retrieves the rendering of the view item when it is disabledgetLabel()Retrieves the label.Retrieves the parent of the view iteminthashCode()static ModelViewItemGroupof(ModelItemGroup modelItem) Creates aModelViewItemGroupwith the items of the givenModelItemGroupstatic ModelViewItemGroupof(ModelItemGroup modelItem, String... itemPaths) Creates aModelViewItemGroupwith the given itemsvoidsetDefinition(T definition) Sets the referenced model item definitionvoidsetDisabledItemRendering(ModelViewItem.DisabledItemRendering disabledItemRendering) Sets the rendering of the view item when it is disabledvoidsetParent(ViewItemAccessor parent) Sets the parent of the view itemtoJSON(DefinitionContext context) Converts the view item in a JSON mapvoidtoSAX(ContentHandler contentHandler, DefinitionContext context) Generates SAX events for the view itemtoString()Methods inherited from class org.ametys.runtime.model.AbstractViewItemGroup
addViewItem, clear, equals, getRole, getViewItems, insertViewItem, removeViewItem, setDescription, setLabel, setRoleMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ametys.runtime.model.ModelViewItem
getName, setNameMethods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabelMethods inherited from interface org.ametys.runtime.model.ViewItemAccessor
addViewItems, getModelViewItem, getViewItem, hasModelViewItem, hasModelViewItem, hasModelViewItemMethods inherited from interface org.ametys.runtime.model.ViewItemGroup
copyTo
-
Constructor Details
-
ModelViewItemGroup
public ModelViewItemGroup()
-
-
Method Details
-
of
Creates aModelViewItemGroupwith the items of the givenModelItemGroup- Parameters:
modelItem- the model item group- Returns:
- the created
ModelViewItemGroup - Throws:
IllegalArgumentException- if the model item isnull
-
of
public static ModelViewItemGroup of(ModelItemGroup modelItem, String... itemPaths) throws IllegalArgumentException, BadItemTypeException Creates aModelViewItemGroupwith the given items- Parameters:
modelItem- the model item containing items definitionsitemPaths- the paths of the items to put in the view item- Returns:
- the created
ModelViewItemGroup - Throws:
IllegalArgumentException- if the model item 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
-
getDefinition
Description copied from interface:ModelViewItemRetrieves the referenced model item definition- Specified by:
getDefinitionin interfaceModelViewItem<T extends ModelItemGroup>- Returns:
- the referenced definition
-
setDefinition
Description copied from interface:ModelViewItemSets the referenced model item definition- Specified by:
setDefinitionin interfaceModelViewItem<T extends ModelItemGroup>- Parameters:
definition- the referenced definition
-
getParent
Description copied from interface:ViewItemRetrieves the parent of the view item -
setParent
Description copied from interface:ViewItemSets the parent of the view item -
getLabel
Description copied from interface:LabelableRetrieves the label.- Specified by:
getLabelin interfaceLabelable- Overrides:
getLabelin classAbstractViewItemGroup- Returns:
- the label.
-
getDescription
Description copied from interface:LabelableRetrieves the description.- Specified by:
getDescriptionin interfaceLabelable- Overrides:
getDescriptionin classAbstractViewItemGroup- Returns:
- the description.
-
getDisabledItemRendering
Description copied from interface:ModelViewItemRetrieves the rendering of the view item when it is disabled- Specified by:
getDisabledItemRenderingin interfaceModelViewItem<T extends ModelItemGroup>- Returns:
- the rendering of the view item when it is disabled
-
setDisabledItemRendering
Description copied from interface:ModelViewItemSets the rendering of the view item when it is disabled- Specified by:
setDisabledItemRenderingin interfaceModelViewItem<T extends ModelItemGroup>- Parameters:
disabledItemRendering- the rendering to set
-
toJSON
Description copied from interface:ViewItemConverts the view item in a JSON map -
_childrenToJSON
Converts the group's children in a JSON map- Parameters:
context- the context of the definitions referenced in this group and/or the children- Returns:
- The children as a JSON map
-
toSAX
Description copied from interface:ViewItemGenerates SAX events for the view item- Specified by:
toSAXin interfaceViewItem- Parameters:
contentHandler- theContentHandlerthat will receive the SAX eventscontext- the context of the definitions included in the view item- Throws:
SAXException- if an error occurs during the SAX events generation
-
additionalDataToSAX
protected void additionalDataToSAX(ContentHandler contentHandler, DefinitionContext context) throws SAXException Permit to generate SAX events for additional data in sub classes- Parameters:
contentHandler- theContentHandlerthat will receive the SAX eventscontext- the context of the definitions included in the view item- Throws:
SAXException- if an error occurs during the SAX events generation
-
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 not copied- Specified by:
copyToin interfaceViewItem- Overrides:
copyToin classAbstractViewItemGroup- Parameters:
item- the copy
-
createInstance
Description copied from interface:ViewItemCreate an instance ofViewItem- Specified by:
createInstancein interfaceViewItem- Returns:
- the created instance
-
hashCode
- Overrides:
hashCodein classAbstractViewItemGroup
-
equals
- Overrides:
equalsin classAbstractViewItemGroup
-
toString
-