Package overit.geocall.basic.ui.control
Class Layout
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocall.basic.ui.control.Layout
- All Implemented Interfaces:
Serializable,Comparable<Layout>,overit.geocall.marks.MethodExposer,overit.geocall.marks.NameExposer,Identified,Tool
This component only takes effect within the ResponsiveGrid and defines the child component's arrangement, referencing
it or via the corresponding
To visualize the components in line it is sufficient to define a layout by writing the
LAYOUTNAME (as shown in the example) or, without this, via the
NAME.To visualize the components in line it is sufficient to define a layout by writing the
LAYOUTNAME of the various components one after the other (the number of spaces
inserted between a LAYOUTNAME and the other has no graphic effect, but allows to align the columns making them
easier readable).
<Layout>
NAME SURNAME EMAIL
</Layout>
To display them in Column it is sufficient to write the LAYOUTNAME of the various components one below the other
<Layout>
NAME
SURNAME
EMAIL
</Layout>
Combining the two techniques it is possible to create a grid, possibly inserting empty cells using the dot character.
The following example shows a 2x2 grid in which the first column of the second row is empty.
<Layout>
NAME SURNAME
. EMAIL
</Layout>
It is possible for a component to occupy 2 or more columns / rows simply by repeating the LAYOUTNAME in 2 the more
adjacent columns / rows. The following example presents a grid in which the email field occupies the two columns of
the second row.
<Layout>
NAME SURNAME
EMAIL EMAIL
</Layout>
- See Also:
- GCApi:
- component
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumstatic enumprotected static enumprotected static enumNested classes/interfaces inherited from class overit.geocall.ui.Component
Component.Configurable, Component.ConfigurableAttribute, Component.ConfigurableAttributes, Component.FilterCriteria, Component.Registry -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected SimpleMatrixprotected Layout.Modeprotected Layout.Sizeprotected Layout.Spacingprotected Layout.Targetprotected booleanprotected Stringstatic final Stringstatic final Stringstatic final Stringprotected booleanprotected booleanprotected Stringprotected Stringstatic final StringFields 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 TypeMethodDescriptionvoidaddChildText(String layout) Empty methodprotected voidalignDescriptions(StringBuilder builder) voidassignComponentsToArea(List<Component> components) voidassignComponentToAreaIfAbsent(Component component, Consumer<Component> consumer) intprotected static Layoutcreate(Component parent, SimpleMatrix matrix) protected overit.geocall.basic.ui.control.Layout.AreacreateArea(String name, int row, int col) protected static LayoutcreateDefault(Component parent) voidcreateLayout(String definition) protected voidcreateLayout(SimpleMatrix matrix) protected voidcreateSideLabelGridTemplate(StringBuilder builder, overit.geocall.basic.ui.control.Layout.AreaMetadata metadata) protected voidcreateSideLabelGridTemplateForIE(StringBuilder builder, overit.geocall.basic.ui.control.Layout.AreaMetadata metadata) protected voidcreateTopLabelGridTemplate(StringBuilder builder, overit.geocall.basic.ui.control.Layout.AreaMetadata metadata) protected voidcreateTopLabelGridTemplateForIE(StringBuilder builder, overit.geocall.basic.ui.control.Layout.AreaMetadata metadata) booleanoverit.geocall.basic.ui.control.Layout.AreagetArea(int column, int row) protected overit.geocall.basic.ui.control.Layout.AreagetAreaComponent(String layoutName) protected Collection<overit.geocall.basic.ui.control.Layout.Area> getAreas()Gets the String representation of this layoutprotected intgetCols()Gets the default layout defined by xml or by the profile configuration.org.apache.ecs.ElementAbstract method that must be extended and returns the html code of the Componentprotected SimpleMatrixgetMode()Gets The real grid parent name of the component.protected intgetRows()getSize()Returns the spacing of the LayoutGets the static layout defined by xml.
This layout may be equals to the default layout when there is no profile layout configuration setbooleanGets if the layout has a default or not.inthashCode()booleanGets if this Layout has a user's configuration, or not.booleanGets if the layout it's created starting from a programmatically xml definition or if it's has been added via configuration by the user.booleanGets whether the layout it's used for support reason only.voidvoidSets a list of widths separated by a comma, for each column of the layout.
The widths can be specified with any measurement unit allowed via css for the width attribute.voidSets the default layout.voidsetHasDefaultBase(boolean b) Indicates whether the layout has a default or not.voidsetIsBasedOnXML(boolean b) Indicates whether the layout it's created starting from a programmatically xml definition or if it's has been added via configuration by the user.voidsetIsForSupport(boolean b) Indicates whether the layout it's used for support reason only.voidIndicates the alignment mode of the labels against the component.voidIndicates the real ResponsiveGrid parent name for the component.
This attribute will be used when the Layout will be used as a fake layout to populate the SortableGrid object and use the gridstack plugin to configure the grid layout.voidIndicates the maximum size of the workarea or viewport within which this layout is activated.voidSets the spacing of the Layout.voidSets the static layout defined by xml for this layout.
This layout may be equals to the default layout when there is no profile layout configuration setvoidIndicates whether the layout should be chosen considering the size of the window rather than the workarea.protected voidsetup()Setup the ComponentvoidvoidsetupComponentVisibilityBasedOnOldUserConfigs(Set<String> userDiffs, Component c) voidsetupComponentVisibilityNew(Set<String> visibilitySet, Component c) protected voidshowOnlyDefinedAreas(StringBuilder builder) protected StringtoAreaName(String s) toString()Methods inherited from class overit.geocall.ui.Component
adapt, ajaxQuery, appendAttribute, buildDisplayScript, buildSetupScript, 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, getKEYLABEL, getLABEL, getLayoutLabel, getLayoutName, getNAME, getParentComponent, getParentContainer, getPublishedChildrenList, getRegistryName, getSHORTCUT, getTabIndex, getTeacher, getValuesContainer, getWindow, initChilds, isActivable, isActive, isAliasField, isConfigHidden, isDefaultHidden, isExtendedField, isImportant, 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, tabIndexer
-
Field Details
-
GRID_CLASS_CONFIGURATION_WIDGET
- See Also:
-
VISIBILITY_OBJ_CONF
- See Also:
-
FIELDS_OBJ_CONF
- See Also:
-
GRIDS_OBJ_TEMP_PREFIX
- See Also:
-
_size
-
_mode
-
_target
-
_spacing
-
_areaMap
-
_matrix
-
_css
-
isForSupport
protected boolean isForSupport -
defaultLayout
-
staticLayout
-
realParentName
-
isBasedOnXML
protected boolean isBasedOnXML -
defaultBased
protected boolean defaultBased
-
-
Constructor Details
-
Layout
public Layout()
-
-
Method Details
-
create
-
createDefault
-
setSIZE
Indicates the maximum size of the workarea or viewport within which this layout is activated.- Parameters:
s- The accepted values ??are:- XL: the layout is activated for all window sizes (default)
- LG: the layout is activated if the viewport / workarea does not exceed 1200px. Otherwise the XL layout is activated
- MD: the layout is activated if the viewport / workarea does not exceed 992px. Otherwise the LG layout is activated
- SM: the layout is activated if the viewport / workarea does not exceed 768px. Otherwise the MD layout is activated
- XS: the layout is activated if the viewport / workarea does not exceed 567px. Otherwise the SM layout is activated
-
setMODE
Indicates the alignment mode of the labels against the component.- Parameters:
s- The allowed values ??are:- arranging: the label is positioned to the left of the component (default)
- control: the label is positioned above the component
-
getSize
- Returns:
- the maximum size of the workarea or viewport within which this layout is activated.
-
getMode
- Returns:
- the alignment mode of the label against the component
-
setTarget
Indicates whether the layout should be chosen considering the size of the window rather than the workarea. In the first case, the grid will react only after resizing the browser window, while in the second case it will also on the TaskBar open/close.- Parameters:
t- TheLayout.Target
-
setIsForSupport
public void setIsForSupport(boolean b) Indicates whether the layout it's used for support reason only. An example is when layout is used to create and populate theSortableGridComponents.- Parameters:
b-trueorfalse.
-
isForSupport
public boolean isForSupport()Gets whether the layout it's used for support reason only. An example is when layout is used to create and populate theSortableGridComponents.- Returns:
- true if is for support
-
setIsBasedOnXML
public void setIsBasedOnXML(boolean b) Indicates whether the layout it's created starting from a programmatically xml definition or if it's has been added via configuration by the user.- Parameters:
b-trueorfalse.
-
setHasDefaultBase
public void setHasDefaultBase(boolean b) Indicates whether the layout has a default or not.- Parameters:
b-trueorfalse.
-
isBasedOnXML
public boolean isBasedOnXML()Gets if the layout it's created starting from a programmatically xml definition or if it's has been added via configuration by the user.- Returns:
- true if is based on xml
-
hasDefaultBase
public boolean hasDefaultBase()Gets if the layout has a default or not.- Returns:
- true if is based on xml
-
setRealParentName
Indicates the real ResponsiveGrid parent name for the component.
This attribute will be used when the Layout will be used as a fake layout to populate the SortableGrid object and use the gridstack plugin to configure the grid layout. In that case the parent for the Layout will be a fake parent, so with this attribute it could be possible to hold trace of the real grid parent name.- Parameters:
s- The realParentName to set
-
getRealParentName
Gets The real grid parent name of the component.- Returns:
- string of real grid parent name of the component
-
getSpacing
Returns the spacing of the Layout- Returns:
- The
Layout.Spacing
-
setSpacing
Sets the spacing of the Layout.- Parameters:
s- The accepted values are:- control: standard spacing to use when components are
Control(default) - container: increased spacing, to be used when the components are
Containers
- control: standard spacing to use when components are
-
setCOLUMNSWIDTH
Sets a list of widths separated by a comma, for each column of the layout.
The widths can be specified with any measurement unit allowed via css for the width attribute.- Parameters:
s- a list of widths separated by a comma, for each column of the layout
-
getAreas
-
getArea
-
getArea
public overit.geocall.basic.ui.control.Layout.Area getArea(int column, int row) -
getAreaComponent
-
getRows
protected int getRows() -
getCols
protected int getCols() -
getMatrix
-
getHtml
Description copied from class:ComponentAbstract method that must be extended and returns the html code of the Component -
addChildText
Description copied from class:UINodeEmpty method- Overrides:
addChildTextin classUINode- Parameters:
layout- Not used
-
addExtendedAttributesOnLayout
-
addUnknownStaticComponentOnLayout
-
hasUserConfigurations
public boolean hasUserConfigurations()Gets if this Layout has a user's configuration, or not.
This method it's used byResponsiveGridandResponsiveGridFrameto know if they have to highlight the config icon or not in order to communicate to the user that the Grid is changed or not.- Returns:
- if this Layout has a user's configuration, or not.
-
reloadLayout
public void reloadLayout() -
getDefaultLayout
Gets the default layout defined by xml or by the profile configuration.- Returns:
- the default layout defined by xml or by the profile configuration.
-
setDefaultLayout
Sets the default layout.- Parameters:
s- the default layout to set.
-
getStaticLayout
Gets the static layout defined by xml.
This layout may be equals to the default layout when there is no profile layout configuration set- Returns:
- the static layout defined by xml.
-
setStaticLayout
Sets the static layout defined by xml for this layout.
This layout may be equals to the default layout when there is no profile layout configuration set- Parameters:
s- the static layout defined by xml to set.
-
setup
protected void setup()Description copied from class:ComponentSetup the Component -
toString
-
getAsText
Gets the String representation of this layout- Returns:
- the String representation of this layout
-
showOnlyDefinedAreas
-
alignDescriptions
-
createSideLabelGridTemplate
protected void createSideLabelGridTemplate(StringBuilder builder, overit.geocall.basic.ui.control.Layout.AreaMetadata metadata) -
createSideLabelGridTemplateForIE
protected void createSideLabelGridTemplateForIE(StringBuilder builder, overit.geocall.basic.ui.control.Layout.AreaMetadata metadata) -
createTopLabelGridTemplate
protected void createTopLabelGridTemplate(StringBuilder builder, overit.geocall.basic.ui.control.Layout.AreaMetadata metadata) -
createTopLabelGridTemplateForIE
protected void createTopLabelGridTemplateForIE(StringBuilder builder, overit.geocall.basic.ui.control.Layout.AreaMetadata metadata) -
toAreaName
-
createLayout
-
createLayout
-
createArea
-
assignComponentsToArea
-
assignComponentToAreaIfAbsent
-
setupComponentVisibility
-
setupComponentVisibilityBasedOnOldUserConfigs
-
setupComponentVisibilityNew
-
compareTo
- Specified by:
compareToin interfaceComparable<Layout>
-
equals
-
hashCode
public int hashCode()
-