public interface GXIScreenTagModel
The model provides various methods for adding, removing, replacing and searching tags.
The final tag list in the screen tag model (after all transformations have been completed)
will be rendered to the HTML output by the Renderer entity.
The tags are basically organised in the order they were created, but the order is not important for HTML presentation, since all tags are rendered in absolute terms. The way to search tags is either by checking the direction of the neighboring tag, by ID, by text or by specific position (row, column or both).
Modifier and Type | Method and Description |
---|---|
void |
add(GXITag tag)
Add the specified tag to the screen tag model.
|
void |
addNeighbor(GXITag tag,
GXITag neighborTag,
GXPosition offset)
Add the specified tag to the screen tag model next to the neighboring tag.
|
GXTagList |
executeColumnQuery(int column)
Used for executing column based queries on the screen tag model.
|
GXITag |
executePositionQuery(GXPosition position)
Used for executing position-based queries on the screen model.
|
GXITag |
executePositionQuery(int row,
int column)
Used for executing position-based queries, on the screen tag model.
|
GXTagList |
executeQuery(GXITagQuery query)
Executes a query on the screen model.
|
GXTagList |
executeRowQuery(int row)
Used for executing row based queries on the screen tag model.
|
GXTagList |
executeTextQuery(String searchText)
Used for executing text based queries on the screen tag model.
|
int |
getFontSize()
The font size (in pixels) in which the tags will be displayed.
|
GXITag |
getNeighbor(GXITag tag,
int direction)
Returns the neighboring tag in the specified direction.
|
GXRenderConfig |
getRenderConfig() |
GXITag |
getTagById(String tagId)
Finds a tag by the specified tag ID
|
GXITag[] |
getTags()
Returns a tag's array which contains all the screen tag model root tags.
|
void |
remove(GXITag tag)
Removes the specified tag.
|
void |
replace(GXITag originalTag,
GXITag newTag)
Replaces the specified tag with the original tag in the screen tag model.
|
GXITag getTagById(String tagId)
tagId
- the ID of the searched tagGXTagList executeQuery(GXITagQuery query)
The query can be either a built-in query such as:
GXTextQuery
,
GXAreaQuery
or a user defined query (class that implements GXITagQuery
)
query
- the query to execute.GXTagList executeTextQuery(String searchText)
searchText
- the text to search for within the tags. Searches for sub string matches.GXTagList executeColumnQuery(int column) throws GXIllegalPositionException
column
- The searched tags columnGXIllegalPositionException
- when the column is outside the screen tag model boundsGXIllegalPositionException
GXTagList executeRowQuery(int row) throws GXIllegalPositionException
row
- The searched tags rowGXIllegalPositionException
- when the column is outside the screen tag model boundsGXIllegalPositionException
GXITag executePositionQuery(int row, int column) throws GXIllegalPositionException
row
- The searched tag rowcolumn
- The searched tag columnGXIllegalPositionException
- when the column is outside the screen tag model boundsGXIllegalPositionException
GXITag executePositionQuery(GXPosition position) throws GXIllegalPositionException
position
- The searched positionGXIllegalPositionException
- when the column is outside the screen tag model boundsGXIllegalPositionException
int getFontSize()
GXRenderConfig.setFontSize(int)
GXITag getNeighbor(GXITag tag, int direction) throws GXUndefinedPositionException
tag
- the tag whose neighbor is being searched fordirection
- The direction to searchGXUndefinedPositionException
-
when the specified tag's position is emptyGXUndefinedPositionException
GXTagModelConstants.NEIGHBOR_ABOVE
,
GXTagModelConstants.NEIGHBOR_BELOW
,
GXTagModelConstants.NEIGHBOR_LEFT
,
GXTagModelConstants.NEIGHBOR_RIGHT
void add(GXITag tag)
tag
- The new tag to addGXITag[] getTags()
void addNeighbor(GXITag tag, GXITag neighborTag, GXPosition offset)
tag
- The new tag to addneighborTag
- The neighboring tag of the new tagoffset
- the new tag offset position from the neighboring tagvoid replace(GXITag originalTag, GXITag newTag)
The following original tag properties will be copied to the new tag:
position, length, offsetTop, offsetLeft, hostField
Is useful for changing a tag type. For example, changing a text to a link.
originalTag
- the original tag which should be replacednewTag
- the new tag that should replace the original tagvoid remove(GXITag tag)
tag
- the tag to remove.GXRenderConfig getRenderConfig()
Copyright 2021 Software AG. All rights reserved. Use is subject to license terms.