public class View extends Object implements ViewItemContainer, ModifiableLabelable
| Modifier and Type | Field and Description |
|---|---|
private I18nizableText |
_description |
private String |
_iconDecorator |
private String |
_iconGlyph |
private List<ViewItem> |
_items |
private I18nizableText |
_label |
private String |
_largeIcon |
private String |
_mediumIcon |
private String |
_name |
private String |
_smallIcon |
| Constructor and Description |
|---|
View()
Default constructor
|
View(Model model,
boolean recursive,
String... itemPaths)
Creates a view with the given items
|
View(Model model,
String... itemPaths)
Creates a view with the given items
|
| Modifier and Type | Method and Description |
|---|---|
private ViewItem |
_getViewItemFromDefinition(ModelItem definition,
Boolean recursive) |
void |
addViewItem(ViewItem item)
Add a view item in the container
|
I18nizableText |
getDescription()
Retrieves the description.
|
String |
getIconDecorator()
Retrieves the CSS class to use for decorator above the main icon
|
String |
getIconGlyph()
Retrieves the CSS class to use for glyph icon
|
I18nizableText |
getLabel()
Retrieves the label.
|
String |
getLargeIcon()
Retrieves the URL of the small icon without the context path.
|
String |
getMediumIcon()
Retrieves the URL of the small icon without the context path.
|
String |
getName()
Get the name.
|
String |
getSmallIcon()
Retrieves the URL of the small icon without the context path.
|
List<ViewItem> |
getViewItems()
Retrieves all the view items of this container
|
boolean |
hasViewItem(String itemName)
Checks if there is a view item with the given name
|
void |
includeView(View viewToInclude)
Include the given view to the current one.
|
void |
insertViewItem(ViewItem item,
int index)
Insert a view item in the container at the given index
|
void |
setDescription(I18nizableText description)
Set the description.
|
void |
setIconDecorator(String iconDecorator)
Set the CSS class to use for decorator above the main icon
|
void |
setIconGlyph(String iconGlyph)
Set the CSS class to use for glyph icon
|
void |
setLabel(I18nizableText label)
Set the label.
|
void |
setLargeIcon(String largeIcon)
Set the URL of the large icon.
|
void |
setMediumIcon(String mediumIcon)
Set the URL of the medium icon.
|
void |
setName(String name)
Set the name.
|
void |
setSmallIcon(String smallIcon)
Set the URL of the small icon.
|
Map<String,Object> |
toJSON()
Converts the view in a JSON map
|
private I18nizableText _label
private I18nizableText _description
private String _iconGlyph
private String _iconDecorator
private String _smallIcon
private String _mediumIcon
private String _largeIcon
public View()
public View(Model model, String... itemPaths)
model - the model containing items definitionsitemPaths - the paths of the items to put in the viewprivate ViewItem _getViewItemFromDefinition(ModelItem definition, Boolean recursive)
public void setName(String name)
ModifiableLabelablesetName in interface ModifiableLabelablename - the name.public I18nizableText getLabel()
Labelablepublic void setLabel(I18nizableText label)
ModifiableLabelablesetLabel in interface ModifiableLabelablelabel - the label.public I18nizableText getDescription()
LabelablegetDescription in interface Labelablepublic void setDescription(I18nizableText description)
ModifiableLabelablesetDescription in interface ModifiableLabelabledescription - the description.public String getIconGlyph()
public void setIconGlyph(String iconGlyph)
iconGlyph - the glyph name.public String getIconDecorator()
public void setIconDecorator(String iconDecorator)
iconDecorator - the glyph name.public String getSmallIcon()
public void setSmallIcon(String smallIcon)
smallIcon - the URL of the small icon, without the context path.public String getMediumIcon()
public void setMediumIcon(String mediumIcon)
mediumIcon - the URL of the medium icon, without the context path.public String getLargeIcon()
public void setLargeIcon(String largeIcon)
largeIcon - the URL of the large icon, without the context path.public List<ViewItem> getViewItems()
ViewItemContainergetViewItems in interface ViewItemContainerpublic boolean hasViewItem(String itemName)
ViewItemContainerhasViewItem in interface ViewItemContaineritemName - the name of the itemtrue if the container contains an item with the given name, false otherwisepublic void addViewItem(ViewItem item)
ViewItemContaineraddViewItem in interface ViewItemContaineritem - the item to addpublic void insertViewItem(ViewItem item, int index)
ViewItemContainerinsertViewItem in interface ViewItemContaineritem - the item to insertindex - index at which the item has to be insertedpublic Map<String,Object> toJSON() throws ProcessingException
ProcessingException - If an error occurs when converting the viewpublic void includeView(View viewToInclude)
viewToInclude - the view to include