Package overit.geocall.basic.ui.xlsx
Class XlsxComponent
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.basic.ui.xlsx.XlsxComponent
- All Implemented Interfaces:
Serializable,Identified
- Direct Known Subclasses:
XlsxCell,XlsxContainer,XlsxImage,XlsxSheet,XlsxText
This class extends
This class is a based implementation of the generic Xlsx component.
UINode and implements Identified.This class is a based implementation of the generic Xlsx component.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.poi.ss.usermodel.HorizontalAlignmentprotected IXlsxFormatprotected Stringprotected Stringprotected Stringprotected org.apache.poi.ss.usermodel.VerticalAlignmentprotected String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.poi.ss.usermodel.HorizontalAlignmentgetAlign()Gets the horizontal align type of the component.org.apache.poi.xssf.usermodel.XSSFColorGets the bgXSSFColorof the component.static booleangetBoolean(String s, boolean def) This method is used to convert a boolean string value into a real boolean value.
'true' and '1' are converted intotrue,'false' and '0' are converted intofalseGets the active border of the component.static org.apache.poi.xssf.usermodel.XSSFCellStylestatic org.apache.poi.xssf.usermodel.XSSFCellStylegetBorder(org.apache.poi.xssf.usermodel.XSSFCellStyle cs, String border, org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.xssf.usermodel.XSSFColor borderColor) Gets the border type, theBorderStyleand the borderXSSFColorand set them on aXSSFCellStyle.org.apache.poi.xssf.usermodel.XSSFColorGets the border color of the component.org.apache.poi.ss.usermodel.BorderStyleGets the border style of the component.Gets the usedIXlsxFormatof the cell.org.apache.poi.xssf.usermodel.XSSFCellStyleGets theXSSFCellStyleactually used for the cells.Gets the childIterator.intGets the children's size.org.apache.poi.xssf.usermodel.XSSFColorgetColor()Gets theXSSFColorof the component.protected org.apache.poi.xssf.usermodel.XSSFColorGets the comment of tbe instance.Gets the default value of the instance.Gets the root document.getFont()Gets the used font.shortGets the font size used.
If ther's no font size used the return value will be 10.Returns theIdentityassociated to the componentbooleangetKey()Gets if the component represent a key.getLabel()Gets the label of the instance.getName()Gets the name of tbe instance.Gets the registry name of tbe instance.org.apache.poi.ss.usermodel.SheetgetSheet()Gets the activeSheet.Gets the style name associated with this Excel component for cell style caching.org.apache.poi.ss.usermodel.VerticalAlignmentGets the vertical align type of the component.Gets the warning message.protected booleanprotected voidvoidinitChilds(XlsxContainer parent) Initialise the component's children.booleanisBold()Gets if the used text format is bold or not.booleanGets if the instance is enabled or not.booleanGets if the used state text format is forced bold or not.booleanGets if used forced font size.booleanisHidden()Gets if the instance is hidden or not.booleanisLocked()Gets if the component is locked or not.booleanGets if the column/cells are autoamtically shrink to fit.booleanisWrap()Gets if the the component is wrapped or not.voidonInit(XlsxContainer parent) Initialize the component and its children into the documentvoidSets the horizontal align type for the component.voidsetBGCOLOR(String s) Sets the cell background bg color.voidSets the bold text format to the instance.voidSets the border to the component.voidThis method allows to set the borders of the cells.voidsetBorderColor(org.apache.poi.xssf.usermodel.XSSFColor borderColor) Sets color to the border of the component.voidsetBORDERCOLORRGB(String rgbColor) This method allows to set the color of the borders.voidsetBorderStyle(org.apache.poi.ss.usermodel.BorderStyle borderStyle) Sets style to the border of the component.voidsetBORDERSTYLE(String borderStyle) This method allows to set the style of the borders.voidsetCellFormat(IXlsxFormat cellFormat) voidSets the format class to the cell.voidsetCellStyle(org.apache.poi.xssf.usermodel.XSSFCellStyle cs) Sets theXSSFCellStylefor the cells.voidSets the cell background color.voidsetCOMMENT(String s) Sets the comment for the instance.voidsetDEFAULT(String o) Sets the default value for the instance.voidsetENABLED(String s) Sets the enable property for the instance.voidSets the font to use.voidSets the font size.voidSets the number type format of the cell.voidSets the hidden property for the instance.voidsetIdentity(Identity identity) Sets theIdentityto the componentvoidSets if the component represent a key, and sets its color to red if it is.voidvoidSets the label for the instance.voidSets if the component is locked or not.voidSets the name for the instance.voidSets the registry name for the instance.voidsetSheet(org.apache.poi.ss.usermodel.Sheet s) Sets the activeSheet.voidSets if you want that the cell will be automatically resize based on the width of their content or not.voidsetSTYLENAME(String styleName) Sets the style name for this Excel component, used for cell style caching optimization.voidsetUseBGColor(boolean use) Sets if you want to use bg format color.voidSets if you want to use bg format color.voidvoidsetUseHeadColor(boolean use) Sets if you want to use format color for the header.voidSets if you want to use format color for the header.voidSets the vertical align type for the component.voidSets if the component is wrapped or not.booleanGets if is used the bg format color or not.booleanbooleanGets if is used the format color for the header or not.
-
Field Details
-
_cellFormat
-
_cellFormatClass
-
_font
-
_warning
-
_align
protected org.apache.poi.ss.usermodel.HorizontalAlignment _align -
_valign
protected org.apache.poi.ss.usermodel.VerticalAlignment _valign -
_format
-
-
Constructor Details
-
XlsxComponent
public XlsxComponent()
-
-
Method Details
-
setSTYLENAME
Sets the style name for this Excel component, used for cell style caching optimization.The style name serves as a cache key, enabling efficient reuse of
XSSFCellStyleobjects across multiple cells with identical formatting properties. This significantly improves performance and reduces memory usage when generating large Excel documents.Usage Guidelines:
- Use descriptive names that reflect the formatting purpose (e.g., "header", "data_cell", "total_row")
- Ensure consistent naming across components with identical styling
- Avoid dynamic or unique names that would prevent cache reuse
- Consider hierarchical naming for related styles (e.g., "table_header", "table_data")
- Parameters:
styleName- The name to associate with this component's cell style.- See Also:
-
getStyleName
Gets the style name associated with this Excel component for cell style caching.The style name is used as a cache key, enabling efficient reuse of
XSSFCellStyleobjects. This optimization is particularly beneficial for large Excel documents with many cells sharing similar formatting.- Returns:
- The style name for this component, or null if no explicit style name was set.
-
setSHRINKTOFIT
Sets if you want that the cell will be automatically resize based on the width of their content or not.- Parameters:
s-'true' or '1'if you want to automatically shrink to fit,'false' or '0'otherwise.
-
isShrinkToFit
public boolean isShrinkToFit()Gets if the column/cells are autoamtically shrink to fit.- Returns:
trueif the column/cells are automatically shrink to fit,falseotherwise.
-
setUSEDECIMALSPERCENTAGE
-
useDecimalsPercentage
public boolean useDecimalsPercentage() -
setBOLD
Sets the bold text format to the instance.- Parameters:
s-'true' or '1'to set the bold text format,'false' or '0'otherwise.
-
isBold
public boolean isBold()Gets if the used text format is bold or not.- Returns:
trueif the used text format is bold,falseotherwise.
-
isForcedBoldState
public boolean isForcedBoldState()Gets if the used state text format is forced bold or not.- Returns:
trueif the used state text format is forced bold,falseotherwise.
-
setCellStyle
public void setCellStyle(org.apache.poi.xssf.usermodel.XSSFCellStyle cs) Sets theXSSFCellStylefor the cells.- Parameters:
cs- TheXSSFCellStyleto set.
-
getCellStyle
public org.apache.poi.xssf.usermodel.XSSFCellStyle getCellStyle()Gets theXSSFCellStyleactually used for the cells.- Returns:
- The
XSSFCellStyleactually used for the cells.
-
setFORMAT
Sets the number type format of the cell.- Parameters:
s- Allow format are:- '%' - Percent float format.
- 'i' - Integer format.
- 'f' - Float format.
- 'e' - Accounting red float format.
- default - Account float format.
-
initCellFormat
protected void initCellFormat() -
setIdentity
Description copied from interface:IdentifiedSets theIdentityto the component- Specified by:
setIdentityin interfaceIdentified- Parameters:
identity- The Identity that must be associated to the component
-
getIdentity
Description copied from interface:IdentifiedReturns theIdentityassociated to the component- Specified by:
getIdentityin interfaceIdentified- Returns:
- The Identity of the user currently logged in the application
-
setSheet
public void setSheet(org.apache.poi.ss.usermodel.Sheet s) Sets the activeSheet.- Parameters:
s- TheSheetto set.
-
getSheet
public org.apache.poi.ss.usermodel.Sheet getSheet()Gets the activeSheet.- Returns:
- The acrtve
Sheet.
-
setNAME
Sets the name for the instance.- Parameters:
s- The name to set.
-
getName
Gets the name of tbe instance.- Returns:
- The name of the instance.
-
setREGISTRYNAME
Sets the registry name for the instance.- Parameters:
s- The registry name to set.
-
getRegistryName
Gets the registry name of tbe instance.- Returns:
- The registry name of the instance.
-
setCOMMENT
Sets the comment for the instance.- Parameters:
s- The comment to set.
-
getComment
Gets the comment of tbe instance.- Returns:
- The comment of the instance.
-
setLABEL
Sets the label for the instance.- Parameters:
s- The label to set.
-
getLabel
Gets the label of the instance.- Returns:
- The label of the instance.
-
setDEFAULT
Sets the default value for the instance.- Parameters:
o- The dafault value to set.
-
getDefault
Gets the default value of the instance.- Returns:
- The default value of the instance.
-
setUSEBGCOLOR
Sets if you want to use bg format color.- Parameters:
s-'true' or '1'to use the bg format color,'false' or '0'otherwise.
-
setUseBGColor
public void setUseBGColor(boolean use) Sets if you want to use bg format color.- Parameters:
use-trueto use the bg format color,falseotherwise.
-
useBGColor
public boolean useBGColor()Gets if is used the bg format color or not.- Returns:
trueif the used color format is bg,falseotherwise.
-
setUSEHEADCOLOR
Sets if you want to use format color for the header.- Parameters:
s-'true' or '1'to use the format color for the header,'false' or '0'otherwise.
-
setUseHeadColor
public void setUseHeadColor(boolean use) Sets if you want to use format color for the header.- Parameters:
use-trueto use the format color for the header,falseotherwise.
-
useHeaderColor
public boolean useHeaderColor()Gets if is used the format color for the header or not.- Returns:
trueto use format color for the header,falseotherwise.
-
setHIDDEN
Sets the hidden property for the instance.- Parameters:
s-'true' or '1'to set the instance to hidden,'false' or '0'otherwise.
-
isHidden
public boolean isHidden()Gets if the instance is hidden or not.- Returns:
trueif the instance is hidden,falseotherwise.
-
setENABLED
Sets the enable property for the instance.- Parameters:
s-'true' or '1'to set the enabled property fort the instance,'false' or '0'otherwise.
-
isEnabled
public boolean isEnabled()Gets if the instance is enabled or not.- Returns:
trueif the instance is enabled,falseotherwise.
-
setLOCKED
Sets if the component is locked or not.- Parameters:
s-'true' or '1'if the component must be locked'false' or '0'otherwise.
-
isLocked
public boolean isLocked()Gets if the component is locked or not.- Returns:
trueif the component is lockedfalseotherwise.
-
setWRAP
Sets if the component is wrapped or not.- Parameters:
s-'true' or '1'if you want to wrap the component,'false' or '0'otherwise.
-
isWrap
public boolean isWrap()Gets if the the component is wrapped or not.- Returns:
trueif the component is wrapped,falseotherwise.
-
setFONTSIZE
Sets the font size.- Parameters:
s- The size to set.
-
getFontSize
public short getFontSize()Gets the font size used.
If ther's no font size used the return value will be 10.- Returns:
- The font size used.
-
hasFontSize
protected boolean hasFontSize() -
isForcedFontSize
public boolean isForcedFontSize()Gets if used forced font size.- Returns:
trueif it's used forced font size,falseotherwise.
-
setKEY
Sets if the component represent a key, and sets its color to red if it is.- Parameters:
s-'true' or '1'if the component must be a key'false' or '0'otherwise.
-
getKey
public boolean getKey()Gets if the component represent a key.- Returns:
trueif the component is a keyfalseotherwise.
-
setCOLOR
Sets the cell background color.- Parameters:
s- The background color to set.
-
getColor
public org.apache.poi.xssf.usermodel.XSSFColor getColor()Gets theXSSFColorof the component.- Returns:
- The
XSSFColorof the component.
-
getColor
-
setBGCOLOR
Sets the cell background bg color.- Parameters:
s- The background bg color to set.
-
getBgColor
public org.apache.poi.xssf.usermodel.XSSFColor getBgColor()Gets the bgXSSFColorof the component.- Returns:
- The bg
XSSFColorof the component.
-
getFont
Gets the used font.- Returns:
- The used font.
-
setFONT
Sets the font to use.- Parameters:
s- The font to use.
-
setCELLFORMATCLASS
Sets the format class to the cell.- Parameters:
s- The format to set on the cell.
-
getCellFormat
Gets the usedIXlsxFormatof the cell.- Returns:
- The
IXlsxFormatcell.
-
setCellFormat
-
getAlign
public org.apache.poi.ss.usermodel.HorizontalAlignment getAlign()Gets the horizontal align type of the component.- Returns:
- The
HorizontalAlignmenttype of the component.
-
setALIGN
Sets the horizontal align type for the component.- Parameters:
s- Allow alignement are:- 'C' - Center alignement.
- F' - Fill alignement.
- 'J' - Justify alignement.
- 'L' - Left alignement.
- 'R' - Right alignement.
- default - General alignement.
-
getVAlign
public org.apache.poi.ss.usermodel.VerticalAlignment getVAlign()Gets the vertical align type of the component.- Returns:
- The
VerticalAlignmenttype of the component.
-
setVALIGN
Sets the vertical align type for the component.- Parameters:
s- Allow vertical alignement are:- 'C' - Center vertical alignement.
- B' - Bottom vertical alignement.
- 'J' - Justify vertical alignement.
- 'T' - Top vertical alignement.
- default - Default vertical alignement.
-
setBorder
Sets the border to the component.- Parameters:
b- The border to set.
-
getBorder
Gets the active border of the component.- Returns:
- The active border of the component.
-
setBorderColor
public void setBorderColor(org.apache.poi.xssf.usermodel.XSSFColor borderColor) Sets color to the border of the component.- Parameters:
borderColor- TheXSSFColorto set on border.
-
getBorderColor
public org.apache.poi.xssf.usermodel.XSSFColor getBorderColor()Gets the border color of the component.- Returns:
- The
XSSFColorborder color.
-
setBorderStyle
public void setBorderStyle(org.apache.poi.ss.usermodel.BorderStyle borderStyle) Sets style to the border of the component.- Parameters:
borderStyle- TheBorderStyleto set on border.
-
getBorderStyle
public org.apache.poi.ss.usermodel.BorderStyle getBorderStyle()Gets the border style of the component.- Returns:
- The
BorderStyleof the component.
-
setBORDERSTYLE
This method allows to set the style of the borders. The default style isBorderStyle.THIN.- Parameters:
borderStyle- The type of the style to use. The possible string are those allowed by theBorderStyleclass.
-
setBORDERCOLORRGB
This method allows to set the color of the borders. The default color is black.- Parameters:
rgbColor- The hexadecimal string representing the RGB color. It must be started with'#'character.
-
getBorder
public static org.apache.poi.xssf.usermodel.XSSFCellStyle getBorder(org.apache.poi.xssf.usermodel.XSSFCellStyle cs, String border) -
getBorder
public static org.apache.poi.xssf.usermodel.XSSFCellStyle getBorder(org.apache.poi.xssf.usermodel.XSSFCellStyle cs, String border, org.apache.poi.ss.usermodel.BorderStyle borderStyle, org.apache.poi.xssf.usermodel.XSSFColor borderColor) Gets the border type, theBorderStyleand the borderXSSFColorand set them on aXSSFCellStyle.- Parameters:
cs- TheXSSFCellStylein which sets all border attribute.border- The border type ("borderAll" or "borderBottom", or "borderTop" ecc).borderStyle- The border style.borderColor- The border color.- Returns:
- The
XSSFCellStylein which sets all border attribute
-
setBORDER
This method allows to set the borders of the cells. You can use the methodssetBORDERSTYLE(java.lang.String)andsetBORDERCOLORRGB(java.lang.String)to set the style and color of the borders. The default style of the borders isBorderStyle.THIN. The default color is black.- Parameters:
s- The string to set the sides of the borders. The accepted values are:"A": all sides"T": top side"B": bottom side"L": left side"R": right side
-
getWarning
Gets the warning message.- Returns:
- The warning message.
-
getChildIterator
Gets the childIterator.- Returns:
- The Child
Iterator.
-
getChildSize
public int getChildSize()Gets the children's size.- Returns:
- The children's size.
-
onInit
Initialize the component and its children into the document- Parameters:
parent- TheXlsxContainerparent.
-
getDocument
Gets the root document.- Returns:
- The root of the
XlsxDocument.
-
initChilds
Initialise the component's children.- Parameters:
parent- The parentXlsxContainerof the component.
-
getBoolean
This method is used to convert a boolean string value into a real boolean value.
'true' and '1' are converted intotrue,'false' and '0' are converted intofalse- Parameters:
s- The string to convert.def- The default velue to return if the String s is null.- Returns:
- The boolean value converted.
-
setLabel
-