public interface GXITag
The tag class is host oriented.
It provides a reference to the host field,
and allows locating tags by setting their position setPosition(int, int)
in host units (row, column).
The initial position is derived from the host field, and can be modified.
The position will be rendered to HTML units as top/left.
The tag also contains the methods getAttribute
and setAttribute
which can be used to read/modify any attribute of the tag.
The tag may have an offset setOffsetLeft(double)
, setOffsetTop(double)
from its position.
The offset is used for aligning the tag when neighboring tags such as a combo box that may overlap the tag.
The offset will be added to the final calculated top/left attributes which are derived from the tag's position.
In case the tag doesn't have any position, the offset top/left will be considered as the actual top/left.
A tag may have child tags -
, and a parent tag getChildren()
getParent()
HTML specific tags are also available such as:
Modifier and Type | Method and Description |
---|---|
void |
copyFrom(GXITag tag)
Copies tags fields
|
String |
getAttribute(String name)
Returns the value of an attribute according to its name.
|
double |
getBottomMargin() |
double |
getBottomPadding() |
GXTagList |
getChildren()
Returns the tag's child tags.
|
String |
getContent()
Used for retrieving the content of the tag.
|
GXIField |
getHostField()
Returns the host field which the tag is based on.
|
String |
getId()
Returns the tag's unique ID.
|
int |
getLength()
Returns the length that the tag is considered to occupy on the host
screen.
|
double |
getOffsetHeight() |
double |
getOffsetLeft()
Returns the offset left position
from the
position attribute. |
double |
getOffsetRight()
Returns the offset right position.
|
double |
getOffsetTop()
Returns the offset top position
from the
position attribute. |
GXITag |
getParent()
Returns the parent tag.
|
GXPosition |
getPosition()
Returns the position of the tag in host screen units (row, column).
|
String |
getTagName()
Returns the concrete name of the tag type.
|
double |
getTopMargin() |
double |
getTopPadding() |
boolean |
hasChildren()
Returns
true if the tag has child tags. |
boolean |
isVisible()
Determines whether to display the tag or not.
|
void |
removeAttribute(String name)
Removes an attribute according to its name.
|
void |
setAttribute(String name,
String value)
Sets the value of a given attribute.
|
void |
setBottomMargin(double margin) |
void |
setBottomPadding(double topPadding) |
void |
setId(String id)
Sets a unique ID for the tag.
|
void |
setLength(int length)
Sets the actual length of the tag on the screen tag model.
|
void |
setOffsetHeight(double height) |
void |
setOffsetLeft(double left)
Sets the offset left position.
|
void |
setOffsetRight(double right)
Sets the offset right position.
|
void |
setOffsetTop(double top)
Sets the offset top position.
|
void |
setPosition(GXPosition position)
Sets the position of the tag in host screen units (row, column).
|
void |
setPosition(int row,
int column)
A convenient method for setting row and column instead of using a position object.
|
void |
setTopMargin(double margin) |
void |
setTopPadding(double topPadding) |
void |
setVisible(boolean isVisible)
Sets the tag to be visible/invisible.
|
void |
setVisible(boolean isVisible,
boolean doRender)
Used for setting the tag to be visible/invisible.
|
GXITag getParent()
null
.boolean hasChildren()
true
if the tag has child tags.true
if the tag has child tags. If this tag doesn't
support child tags, this method always returns false
.GXTagList getChildren()
null
.String getId()
Naming convension:
void setId(String id)
id
- a unique ID for tagdouble getOffsetTop()
position
attribute.
The default value is 0.
When either a GUI element transformation and/or a Table transformation is activated,
this attribute may contain a positive value since GUI elements and tables
are "higher" elements then standard labels and text fields,
and the transformation may change this attribute
to avoid tags overlapping each other.
setOffsetTop(double)
,
getOffsetLeft()
,
setOffsetLeft(double)
,
setPosition(GXPosition)
,
getPosition()
void setOffsetTop(double top)
offsetLeft
attribute, adjusts the tag's final top/left positioning
which is based on the position
attribute of the tag.
When the tag has no position, the offset top will be the actual top attribute in the tag output.top
- the top position attribute.getOffsetTop()
,
getOffsetLeft()
,
setOffsetLeft(double)
double getOffsetLeft()
position
attribute.
The default value is 0.
When a GUI element transformation is activated,
this attribute may contain a positive value since GUI elements
are "longer" elements then standard text fields,
and the transformation may change this attribute
to avoid tags overriding each other.
setOffsetLeft(double)
,
getOffsetTop()
,
setOffsetTop(double)
,
setPosition(GXPosition)
,
getPosition()
double getOffsetRight()
position
attribute.
Rendered only when left is 0.
The default value is 0.
setOffsetRight(double)
,
getOffsetTop()
,
setOffsetTop(double)
,
setPosition(GXPosition)
,
getPosition()
void setOffsetLeft(double left)
offsetTop
attribute, adjusts the tag's final top/left positioning
which is based on the position
attribute of the tag.
When the tag has no position, the offset left will be the actual left attribute in the tag output.left
- the left position attributegetOffsetLeft()
,
getOffsetTop()
,
setOffsetTop(double)
,
setPosition(GXPosition)
,
getPosition()
void setOffsetRight(double right)
offsetTop
attribute, adjusts the tag's final top/right positioning
which is based on the position
attribute of the tag, and when configuring to render from right to left.
When the tag has no position, the offset right will be the actual right attribute in the tag output.
For this method to work, you must open the ApplinX Framework Configuration Editor
and select the Render tags from right check box in the Instant node.right
- the right position attributegetOffsetRight()
,
getOffsetTop()
,
setOffsetTop(double)
,
setPosition(GXPosition)
,
getPosition()
void setOffsetHeight(double height)
double getOffsetHeight()
void setTopPadding(double topPadding)
double getTopPadding()
void setBottomPadding(double topPadding)
double getBottomPadding()
double getTopMargin()
void setTopMargin(double margin)
double getBottomMargin()
void setBottomMargin(double margin)
void setPosition(GXPosition position)
GXRenderConfig.setFontSize(int)
,
and the specified offset top/left attributes of the tag.
This attribute is not rendered, since it does not contribute any visual information.
position
- the position that the tag is considered to have on the
host screenGXIScreenTagModel.getNeighbor(GXITag, int)
void setPosition(int row, int column)
row
- the row of the positioncolumn
- the column of the positionsetPosition(GXPosition)
GXPosition getPosition()
The position may also be used for locating neighboring tags using the
method.GXIScreenTagModel.getNeighbor(GXITag, int)
In addition the position may be used for locating tags by position using the
GXIScreenTagModel.executePositionQuery(GXPosition)
method.
This attribute is not rendered, since it does not contribute any visual information.
null
.int getLength()
This attribute should not be rendered, since it does not contribute any visual information.
void setLength(int length)
The length is primarily used for locating the tag by position using the
method,
and for locating neighbors GXIScreenTagModel.executePositionQuery(GXPosition)
.
If a length is not specified the tag will be considered as the size of 1 for search purposes.
GXIScreenTagModel.getNeighbor(GXITag, int)
For text fields, the length attribute determines the actual size of the text field.
This attribute should not be rendered, since it does not contribute any visual information.
length
- the length of the tag on the screen tag modelGXIScreenTagModel.executePositionQuery(GXPosition)
,
GXIScreenTagModel.getNeighbor(GXITag, int)
String getTagName()
void setAttribute(String name, String value)
If the attribute doesn't exist - it is added. If the attribute exists - its value is replaced.
The attribute is case sensitive. All the attributes built by the renderer are lower case.
When adding an HTML css class, it is appended to the other css classes.
To set a single css class use removeAttribute("class")
before the above method.
name
- the name of the attributevalue
- the value to set for the attributeString getAttribute(String name)
name
- the name of the attributenull
is returned.void removeAttribute(String name)
name
- the name of the attributeboolean isVisible()
void setVisible(boolean isVisible)
isVisible
- if the tag should be visiblesetVisible(boolean, boolean)
void setVisible(boolean isVisible, boolean doRender)
style="display:none"
attribute.isVisible
- if the tag should be visibledoRender
- determines if the tag should be rendered invisiblyString getContent()
A unified method for all types of tags. All tag types implementation returns the content from a different property, in order to be able to query any tag for it's content in a generic way.
For example:
GXIField getHostField()
void copyFrom(GXITag tag)
tag
- the tag to copy fromCopyright 2021 Software AG. All rights reserved. Use is subject to license terms.