Package org.adempiere.webui.component
Class ZkCssHelper
- java.lang.Object
-
- org.adempiere.webui.component.ZkCssHelper
-
public final class ZkCssHelper extends Object
Utility function to support ZK functions. Provides functionsfor manipulating the CSS style for ZK components.- Author:
- Andrew Kimball
-
-
Field Summary
Fields Modifier and Type Field Description static String
STYLE_BACKGROUND_COLOR
CSS style property for background color.static String
STYLE_COLOR
CSS style property for color.static String
STYLE_TEXT_ALIGN_CENTER
Centre text alignment CSS style property and value.static String
STYLE_TEXT_ALIGN_LEFT
Left text alignment CSS style property and value.static String
STYLE_TEXT_ALIGN_RIGHT
Right text alignment CSS style property and value.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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)
Obtains the string description of the RGB components of acolor
.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 Detail
-
STYLE_TEXT_ALIGN_LEFT
public static final String STYLE_TEXT_ALIGN_LEFT
Left text alignment CSS style property and value.- See Also:
- Constant Field Values
-
STYLE_TEXT_ALIGN_RIGHT
public static final String STYLE_TEXT_ALIGN_RIGHT
Right text alignment CSS style property and value.- See Also:
- Constant Field Values
-
STYLE_TEXT_ALIGN_CENTER
public static final String STYLE_TEXT_ALIGN_CENTER
Centre text alignment CSS style property and value.- See Also:
- Constant Field Values
-
STYLE_COLOR
public static final String STYLE_COLOR
CSS style property for color.- See Also:
- Constant Field Values
-
STYLE_BACKGROUND_COLOR
public static final String STYLE_BACKGROUND_COLOR
CSS style property for background color.- See Also:
- Constant Field Values
-
-
Method Detail
-
createHexColorString
public static String createHexColorString(Color color)
Obtains the string description of the RGB components of acolor
. The returned string is suitable for using in CSS styles. The red, green and blue components are formatted as hexadecimal characters. Each component is in the range 00 to FF. The entire string is therefore a 6 character string ranging from "000000" to "FFFFFF".- Parameters:
color
- The color for which the string is to be created- Returns:
- The string representation of the colour's RGB components.
-
appendStyle
public static void appendStyle(org.zkoss.zk.ui.HtmlBasedComponent component, String style)
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
public static void appendStyleColor(org.zkoss.zk.ui.HtmlBasedComponent component, Color color)
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:
appendStyleBackgroundColor(HtmlBasedComponent, Color)
,setStyleColor(HtmlBasedComponent, Color)
-
setStyleColor
public static void setStyleColor(org.zkoss.zk.ui.HtmlBasedComponent component, Color color)
Sets CSS color style forcomponent
. Previous styles are removed.- Parameters:
component
- the HTML based ZK component whose CSS style is to be modifiedcolor
- the color to be set- See Also:
setStyleBackgroundColor(HtmlBasedComponent, Color)
,appendStyleColor(HtmlBasedComponent, Color)
-
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(HtmlBasedComponent, Color)
-
setStyleBackgroundColor
public static void setStyleBackgroundColor(org.zkoss.zk.ui.HtmlBasedComponent component, Color color)
Sets CSS background color style forcomponent
. Previous styles are removed.- Parameters:
component
- the HTML based ZK component whose CSS style is to be modifiedcolor
- the color to be set- See Also:
appendStyleBackgroundColor(HtmlBasedComponent, Color)
,setStyleColor(HtmlBasedComponent, Color)
-
-