Package overit.geocall.basic.ui.control
Class Grid
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocall.ui.Control
overit.geocall.basic.ui.control.Grid
- All Implemented Interfaces:
Serializable,overit.geocall.marks.MethodExposer,overit.geocall.marks.NameExposer,Arrangeable,Badgeable,Hideable,Identified,Tool,overit.geocall.ux.configurability.UIConfigurable,overit.geocall.ux.edm.ModelConfigurable
- Direct Known Subclasses:
ArrangingGrid,ContainerGrid,ControlGrid
This is an abstract class that must be extended to implements a component to use
to position the elements within the window.
The purpose of this class is to provide the methods and behaviours of a generic
container element.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class overit.geocall.ui.Component
Component.Configurable, Component.ConfigurableAttribute, Component.ConfigurableAttributes, Component.FilterCriteria, Component.Registry -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected charprotected intprotected byteprotected SimpleMatrixprotected booleanprotected booleanprotected State.Confprotected Stringprotected booleanprotected Stringprotected Stringprotected Stringprotected Stringprotected booleanprotected Stringprotected charprotected SetPredicateprotected booleanFields inherited from class overit.geocall.ui.Control
_blank, _cleaner, _dblink, _enabled, _ro, _title, altEventIconsList, altIcon, ariaDescription, ariaLabel, badge, badgeformat, FILTER_PREFIXES, LABEL_ATTRIBUTE, LABEL_IN_LINE_ATTRIBUTE, STATE_BLANK, STATE_NORMAL, STATE_RO, STATE_ROBLANKFields inherited from class overit.geocall.ui.Component
_basic, _childrenContainers, _currentId, _gridalign, _gridcols, _gridrows, _gridvalign, _iconElement, _id, _keylabel, _label, _layoutName, _name, _parentContainer, _registryName, _shortcut, _tabindex, _transformations, _valuesContainer, aliasField, BR, configHidden, configuredLabel, configuredLabelInLine, defaultHidden, ELEMENT_BR, ELEMENT_NULL, entityContainer, entityName, extendedField, fullHeight, important, labelInLine, layoutLabel, PIXEL_IMG, safeInlineService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static voidaddStructureRow(org.apache.ecs.html.THead t, int cols, int cellsize, String spacing) voidEvery component can add a script to the StringBuilder, script executed when the component is displayed.voidEvery component can add a script to the StringBuilder, script executed when the component is created.protected org.apache.ecs.html.TDcreateTD(int colspan, int rowspan, char align, char valign) protected voidfillBodyRows(int cols, int cellsize, org.apache.ecs.html.TBody tb, int indent, EntitySet es) protected SimpleMatrixbooleanGet if the grid is closable.booleanGet if the grid is set to closed at first time you visit the page having it.org.apache.ecs.ElementgetContentHtml(Object generationhandle, EntitySet es) Returns the html code that represents the active part of the component, i.e. the field and the validation scriptsorg.apache.ecs.ElementgetDescriptionHtml(Object generationhandle, EntitySet es) Returns the html code that represents the component description i.e. the formatted label of the fieldorg.apache.ecs.ElementMethod that creates a button that launches the event associeted to the grid.protected intReturns the object to generate when the Arrangeable element is composed by more than one elementorg.apache.ecs.ElementgetHiddenHtml(Object generationhandle, EntitySet es) Returns the hidden but active html part of an hidden componentorg.apache.ecs.ElementAbstract method that must be extended and returns the html code of the ComponentReturns the published childs.getRef()Returns the name of the attribute used as a reference, pointed by an anchor, to reposition the scrolling of the page following the execution of a non-Ajax eventbooleanGet if the grid is set to closed when it is in read-only mode.booleanReturn if the component is visible on the screen.voidSets the horizontal align the components inside the grid.voidSets the size of the grid border.voidSets the possibility to closed the grid, as long as this is inside aGridFrame.voidsetClosed(boolean b) Set the grid to closed or open based on parameter passed.voidIf the grid is closable, set the status of the grid at first time you visit the page having it.voidSets the event to be launched from grid.voidSets the horizontal size of the grid to fullsize.voidsetLAYOUTCACHE(String enable) Set this grid should cache the internal row/columns structure or must re-evaluate them every time.voidSets the tiling mode of the colums created (using the tag<break>when a column is finished and must start a new column).voidSets programmatically the string that appears as a message for the event associated to the grid.voidSets the string that appears as a message for the event associated to the grid.voidSets one (or more) parameter for the events associated to the grid (seesetEVENT()).voidDefines the name of the attribute used as a reference, pointed by an anchor, to reposition the scrolling of the page following the execution of a non-Ajax eventvoidsetRo(boolean ro) Set the grid in read-only mode based on parameter passed and refresh automatically the user's window.voidSets the grid to closed when it is read-only.voidsetSPACING(String s) Sets the mode to be set for spacing.protected voidsetup()Setup the ComponentvoidSets the vertical align the components inside the grid.voidsetVISIBLE(String s) Sets if the component must be shown on the screen.Methods inherited from class overit.geocall.ui.Control
avoidNull, clean, getBadgeFormat, getBadgeValue, getBLANK, getCleaner, getConfigurableProperties, getDAValues, getDBLINK, getKEYLABEL, getLABEL, getRO, getState, getTITLE, getValues, getWM, isEnabled, isEnabledBasedOnFunction, isFunctionEnabled, isImportant, isRoBasedOnFunction, nameWithNoFilterPrefix, setALTEVENTICON, setALTICON, setARIADESCRIPTION, setARIALABEL, setBADGEFORMAT, setBADGEVALUE, setBLANK, setCLEANER, setConfiguredProperty, setDBLINK, setENABLED, setFUNCTION, setModelProperties, setRO, setTitle, setTITLEMethods inherited from class overit.geocall.ui.Component
adapt, ajaxQuery, appendAttribute, calcKeyLabel, calcLabel, calcShortcut, canBeConfigured, changed, clearConfiguredProperties, componentIterator, componentSize, connect, containerIterator, createAjaxFrame, deprecate, fillSetupScript, generateFlexableFullHeightContainer, generateId, getBASIC, getBoolean, getBoolean, getChildrenComponents, getChildrenContainers, getDefaultLabel, getDefaultLayoutLabel, getEntityContainer, getEntityName, getFullHeight, getGridAlign, getGridCols, getGridRows, getGridVAlign, getHtmlLabel, getHtmlLabel, getIcon, getId, getIdentity, getint, getLayoutLabel, getLayoutName, getNAME, getParentComponent, getParentContainer, getRegistryName, getSHORTCUT, getTabIndex, getTeacher, getValuesContainer, getWindow, initChilds, isActivable, isActive, isAliasField, isConfigHidden, isDefaultHidden, isExtendedField, isLabelInLine, onInit, setActivable, setActive, setAliasField, setBASIC, setConfigHidden, setDEFAULTHIDDEN, setEntityName, setExtendedField, setFULLHEIGHT, setGRIDALIGN, setGRIDCOLS, setGRIDROWS, setGRIDVALIGN, setICON, setIdentity, setIMPORTANT, setLabel, setLABEL, setLABELINLINE, setLAYOUTLABEL, setLAYOUTNAME, setNAME, setREGISTRYNAME, setTooltip, setValuesContainer, stringForJs, tabIndexerMethods inherited from class overit.geocall.platform.ui.UINode
addChild, addChildText, getChildren, getNodeId, getParent, getRoot, getSchema, setNodeId, setParent, setSchemaMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface overit.geocall.ui.Badgeable
badgeFormat, makeBadgedIconMethods inherited from interface overit.geocall.ui.Hideable
getVISIBLE
-
Field Details
-
_visible
-
_event
-
_param
-
_msg
-
_fullsize
protected boolean _fullsize -
_border
protected int _border -
_align
protected char _align -
_valign
protected char _valign -
_mode
-
_childrenMatrix
-
_ref
-
_closable
protected boolean _closable -
_closed
protected boolean _closed -
_roclosed
protected boolean _roclosed -
_cellsize
protected byte _cellsize -
_spacing
-
_conf
-
layoutCache
protected boolean layoutCache
-
-
Constructor Details
-
Grid
public Grid()
-
-
Method Details
-
setREF
Defines the name of the attribute used as a reference, pointed by an anchor, to reposition the scrolling of the page following the execution of a non-Ajax event- Parameters:
s- The name of the reference that must correspond to the name of an anchor
-
setSPACING
Sets the mode to be set for spacing. It is usually set by the theme used.- Parameters:
s- The string that rappresents the name of the mode to use for the spacing. The standard names mode are:control,container,arranging.
-
setVISIBLE
Sets if the component must be shown on the screen.- Specified by:
setVISIBLEin interfaceHideable- Parameters:
s- The string containing the boolean value to set as visibility of the component.
-
isVisible
public boolean isVisible()Return if the component is visible on the screen. -
setEVENT
Sets the event to be launched from grid. When the event is set, a button outside the grid is shown to launch it. The button hasn't set an icon, so it must be defined. This component can be used on any grid except for direct child grids of gridFrame.- Parameters:
s- Name of the event to launch
-
setMSG
Sets the string that appears as a message for the event associated to the grid.
If there is a message, when the user launch the event a javascript alert will appear, containing the message and two buttons; by pressing one of the two the event will be triggered, while pressing the other will not. Therefore usually this alert is used to request confirmation of proceeding to the user.
Using this method the message will be translated by theTeacher.- Parameters:
s- A string that represents the message contained in the alert that will appears when the user clicks the Button
-
setPARAM
Sets one (or more) parameter for the events associated to the grid (seesetEVENT()).
For the association event - parameter, it counts the position in which the attributes appear. If the parameters are fewer than the events, the last parameter of the list is associated with all the remaining events.- Parameters:
s- AListAttributeof strings (separated by the character | ) each of which represents the param attribute of an event associated to the field
-
setALIGN
Sets the horizontal align the components inside the grid. If isn't set, the default value isleft. It's possible override this value for each item contained using the methodsetGRIDALIGN().- Parameters:
s- The character indicating which horizontal align to use. The possible value are:'l': left'c': center'r': right
-
setVALIGN
Sets the vertical align the components inside the grid. If isn't set, the default value isleft. It's possible override this value for each item contained using the methodsetGRIDVALIGN().- Parameters:
s- The character indicating which horizontal align to use. The possible value are:'t': top'c': center'b': bottom
-
setFULLSIZE
Sets the horizontal size of the grid to fullsize. So, when it is sets totrue, the width of the grid will occupy all the space possible- Parameters:
s- String containing the boolean value to enable fullsize mode or not.
-
setBORDER
Sets the size of the grid border. The default is0because this method is usally used in debugging to understand the occupation of the grid.- Parameters:
s- String containing an integer corresponding to the thickness of the border.
-
setMODE
Sets the tiling mode of the colums created (using the tag<break>when a column is finished and must start a new column). The possible mode are "from left to right" or "from top to bottom". In the first mode each column is composed by inserting the elements one below the other, and the columns are placed side by side starting from the left. In the second mode each column is composed by inserting the elements one next to the other, and the columns (in this case it would be more correct to speak of lines) are one below the other starting from the top.- Parameters:
s- String containing the value of the mode to be set. The accepted values are:'lr': from left to right'tp': from top to bottom
-
setCLOSABLE
Sets the possibility to closed the grid, as long as this is inside aGridFrame. Moreover it is necessary to set a label to the grid (seesetLABEL()) to enable the possibility to close it. If you don't want to write anything into the label, it is possible to leave empty the label value.- Parameters:
s- String containing the boolean value to enable closable mode or not.
-
setCLOSED
If the grid is closable, set the status of the grid at first time you visit the page having it. The next time the status will be recovered from the database to restore the last active state.- Parameters:
s- String containing the boolean value to set the grid in the closed state or not.
-
setROCLOSED
Sets the grid to closed when it is read-only.- Parameters:
s- String containing the boolean value to set the grid in the closed state when it is read-only.
-
setLAYOUTCACHE
Set this grid should cache the internal row/columns structure or must re-evaluate them every time.- Parameters:
enable- setfalseif the children of this Grid are dynamically added via API;trueotherwise
-
getRef
Returns the name of the attribute used as a reference, pointed by an anchor, to reposition the scrolling of the page following the execution of a non-Ajax event- Returns:
- s The name of the reference, that correspond to the name of an anchor
-
getClosable
public boolean getClosable()Get if the grid is closable.- Returns:
- The boolean to know if the grid is closable.
-
getROClosed
public boolean getROClosed()Get if the grid is set to closed when it is in read-only mode.- Returns:
- The boolean to know if the grid is set to closed in read-only mode.
-
getClosed
public boolean getClosed()Get if the grid is set to closed at first time you visit the page having it. Obviously, the grid must be closable.- Returns:
- The boolean to know if the grid is set to closed at first time you visit the page having it.
-
setClosed
public void setClosed(boolean b) Set the grid to closed or open based on parameter passed. Obviously the grid must be set to closable, otherwise you recive theNullPointerException. This method refresh automatically the user's window.- Parameters:
b- The boolean to use to set the grid in closed or open mode.
-
setRo
public void setRo(boolean ro) Set the grid in read-only mode based on parameter passed and refresh automatically the user's window. If the grid is set to unclosable, using this method has no effect.- Parameters:
ro- The boolean to use to set the grid in closed or open mode when it is in read-only state.
-
setMsg
Sets programmatically the string that appears as a message for the event associated to the grid.
Using this method the message will not be translated by theTeacher.
SeesetMSG(java.lang.String)for the meaning of the attribute.- Parameters:
s- A string that represents the message contained in the alert that will appears when the user launch the event assacieted to the grid.
-
setup
protected void setup()Description copied from class:ComponentSetup the Component -
getChildrenMatrix
-
addStructureRow
protected static void addStructureRow(org.apache.ecs.html.THead t, int cols, int cellsize, String spacing) -
getContentHtml
Description copied from interface:ArrangeableReturns the html code that represents the active part of the component, i.e. the field and the validation scripts- Specified by:
getContentHtmlin interfaceArrangeable- Parameters:
generationhandle- the unique generatin handlees- the page entity set- Returns:
- The html code of the component
-
fillBodyRows
protected void fillBodyRows(int cols, int cellsize, org.apache.ecs.html.TBody tb, int indent, EntitySet es) -
getHiddenHtml
Description copied from interface:ArrangeableReturns the hidden but active html part of an hidden component- Specified by:
getHiddenHtmlin interfaceArrangeable- Parameters:
generationhandle- the unique generatin handlees- the page entity set- Returns:
- The html code of the hidden part of the component
-
getDescriptionHtml
Description copied from interface:ArrangeableReturns the html code that represents the component description i.e. the formatted label of the field- Specified by:
getDescriptionHtmlin interfaceArrangeable- Parameters:
generationhandle- the unique generatin handlees- the page entity set- Returns:
- The html code of the label of the field
-
getGenerationHandle
Description copied from interface:ArrangeableReturns the object to generate when the Arrangeable element is composed by more than one element- Specified by:
getGenerationHandlein interfaceArrangeable- Returns:
- The Object to generate
-
getHtml
Description copied from class:ComponentAbstract method that must be extended and returns the html code of the Component -
createTD
protected org.apache.ecs.html.TD createTD(int colspan, int rowspan, char align, char valign) -
getEventButton
public org.apache.ecs.Element getEventButton()Method that creates a button that launches the event associeted to the grid. If the grid is read-only, the event is not added to the button. Otherwise the event that button will launch will be the one associeted via the methodsetEVENT()with parameters and message set via the methodssetPARAM()andsetMSG().- Returns:
- Return the
Buttonelement with the event associeted.
-
getPublishedChildrenList
Description copied from class:ComponentReturns the published childs. Those that are not published are not even searched to be synchronized via Ajax- Overrides:
getPublishedChildrenListin classComponent- Returns:
- The
Listof published childs
-
buildDisplayScript
Description copied from class:ComponentEvery component can add a script to the StringBuilder, script executed when the component is displayed.- Overrides:
buildDisplayScriptin classComponent- Parameters:
sb- The StringBuilder on which we want to add the script
-
buildSetupScript
Description copied from class:ComponentEvery component can add a script to the StringBuilder, script executed when the component is created.- Overrides:
buildSetupScriptin classComponent- Parameters:
sb- The StringBuilder on which we want to add the script
-
getFullHeightChilds
protected int getFullHeightChilds()
-