Package org.adempiere.webui.component
Class ZkCssHelper
java.lang.Object
org.adempiere.webui.component.ZkCssHelper
Utility function to support ZK functions.
Provides functionsfor manipulating the CSS style of
ZK components.
- Author:
- Andrew Kimball
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
CSS style property for background color.static final String
CSS style property for color.static final String
Centre text alignment CSS style property and value.static final String
Left text alignment CSS style property and value.static final String
Right text alignment CSS style property and value. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
appendStyle
(org.zkoss.zk.ui.HtmlBasedComponent component, String style) Adds a new CSS style tocomponent
.static void
appendStyleBackgroundColor
(org.zkoss.zk.ui.HtmlBasedComponent component, Color color) Adds a CSS background color style tocomponent
.static void
appendStyleColor
(org.zkoss.zk.ui.HtmlBasedComponent component, Color color) Adds a CSS color style tocomponent
.static String
createHexColorString
(Color color) Create hex string color code from the RGB components ofColor
.
The returned string is suitable for using in CSS styles.static void
setStyleBackgroundColor
(org.zkoss.zk.ui.HtmlBasedComponent component, Color color) Sets CSS background color style forcomponent
.static void
setStyleColor
(org.zkoss.zk.ui.HtmlBasedComponent component, Color color) Sets CSS color style forcomponent
.
-
Field Details
-
STYLE_TEXT_ALIGN_LEFT
Left text alignment CSS style property and value.- See Also:
-
STYLE_TEXT_ALIGN_RIGHT
Right text alignment CSS style property and value.- See Also:
-
STYLE_TEXT_ALIGN_CENTER
Centre text alignment CSS style property and value.- See Also:
-
STYLE_COLOR
CSS style property for color.- See Also:
-
STYLE_BACKGROUND_COLOR
CSS style property for background color.- See Also:
-
-
Method Details
-
createHexColorString
Create hex string color code from the RGB components ofColor
.
The returned string is suitable for using in CSS styles.- Parameters:
color
- Color- Returns:
- Hex string color code of the colour's RGB components.
-
appendStyle
Adds a new CSS style tocomponent
. The ";" prefix is not required.- Parameters:
component
- the HTML based ZK component whose CSS style is to be modifiedstyle
- CSS style string to append to current style
-
appendStyleColor
Adds a CSS color style tocomponent
. The current style of the component is retained.- Parameters:
component
- the HTML based ZK component whose CSS style is to be modifiedcolor
- the color to be set- See Also:
-
setStyleColor
Sets CSS color style forcomponent
. Current style of component will be replaced.- Parameters:
component
- the HTML based ZK component whose CSS style is to be modifiedcolor
- the color to be set- See Also:
-
appendStyleBackgroundColor
public static void appendStyleBackgroundColor(org.zkoss.zk.ui.HtmlBasedComponent component, Color color) Adds a CSS background color style tocomponent
. The current style of the component is retained.- Parameters:
component
- the HTML based ZK component whose CSS style is to be modifiedcolor
- the color to be set- See Also:
-
setStyleBackgroundColor
public static void setStyleBackgroundColor(org.zkoss.zk.ui.HtmlBasedComponent component, Color color) Sets CSS background color style forcomponent
. Current style of component will be replaced.- Parameters:
component
- the HTML based ZK component whose CSS style is to be modifiedcolor
- the color to be set- See Also:
-