Package wt.clients.util
Class ContainerColorUtility
java.lang.Object
wt.clients.util.ContainerColorUtility
This class is used to recursively apply the same background,
foreground, and font to all components within a container. This
can be used as a static method or an instance method. This class
contains color defaults that can be changed. There are several
ways to use this class.
1) ContainerColorUtility.colorContainer(aContainer);
This will color the container and all of its components to the
default colors defined in this class.
2) ContainerColorUtility.setBackground(newColor);
ContainerColorUtility.setForeground(newColor);
.
.
ContainerColorUtility.colorContainer(aContainer);
This will change the default colors and any time that colorContainer
is subsequently called, it will use the newColors
3) ContainerColorUtility utility = new ContainerColorUtility();
utility.setComponent(specificComponent)
utility.setForeground(newColor);
.
.
utility.colorContainer();
This will create and instance of the utility and the newColors
defined here will only apply to that instance of the
specificComponent and any subsequent calls to colorContainer with
a different instance will be using the default colors not the
newColors.
4) utility.colorContents();
The
Supported API: true.
Extendable: false.
colorContents() method will color only the contents
of the container and not the container itself. This is useful for
beans when overriding setBackground, etc. The following
is an example of how a bean may want to override.
ContainerColorUtility utility = new ContainerColorUtility(this);
.
.
public void setBackground(Color newColor) {
super.setBackground(newColor);
utility.setBackground(newColor);
utiltiy.colorContents();
}
Supported API: true.
Extendable: false.
-
Constructor Summary
ConstructorsConstructorDescriptionThis constructs and instance of the ContainerColorUtility
Supported API: true.ContainerColorUtility(Container container) This constructs and instance of the ContainerColorUtility and setsmyContainerto the container passed in. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidIterates through the container and colors the components within
Supported API: true.voidCall this method when you want to color only the instance of the container that this class is holding and its components.static voidcolorContainer(Container container) This is the static method that can be used to color a container with the defined colors and recursively color its components.voidUse this method to color the contents of the container instance but not the container itself.static voidcolorContents(Container container) Use this static method to color the contents of the container passed in but not the container itself.protected voidcolorContentsOfContainer(Container container) this colors the contents of the container instance but not the container itself.This sets the background for this instance.This gets the background of multilist cells for this instance.This gets the foreground of multilist cells for this instance.This gets the background color for choice boxes for this instance.This is the getter for themyContainerattribute.static ColorThis gets the background for all instances.static ColorThis gets the background of multilist cells for all instances.static ColorThis gets the foreground of multilist cells for all instances.static ColorThis gets the background of choice boxes for all instances.static FontThis gets the font for all instances.static ColorThis gets the foreground for all instances.static ColorThis gets the background of multilist headers for all instances.static ColorThis gets the foreground of multitlist headers for all instances.static ColorThis gets the background of text components for all instances.getFont()This gets the font for this instance.This gets the foreground color for this instance.This gets the background of multilist headings for this instance.This gets the foreground of the multilist headers for this instance.This gets the background color for choice text components for this instance.voidsetBackground(Color new_background) This sets the background for this instance.voidsetCellBackground(Color cell_background) This sets the background of multilist cells for this instance.voidsetCellForeground(Color cell_foreground) This sets the foreground of multilist cells for this instance.voidsetChoiceBackground(Color new_choice_background) This sets the background color for choice boxes for this instance.voidsetContainter(Container container) This is a setter for themyContainerattribute.static voidsetDefaultBackground(Color new_background) This sets the background for all instances.static voidsetDefaultCellBackground(Color cell_background) This sets the background of multilist cells for all instances.static voidsetDefaultCellForeground(Color cell_foreground) This sets the foreground of multilist cells for all instances.static voidsetDefaultChoiceBackground(Color new_choice_background) This sets the background of the choice boxes for all instances.static voidsetDefaultFont(Font new_font) This sets the font for all instances.static voidsetDefaultForeground(Color new_foreground) This sets the foreground for all instances.static voidsetDefaultHeadingBackground(Color heading_background) This sets the background of multilist headers for all instances.static voidsetDefaultHeadingForeground(Color heading_foreground) This sets the foreground of multilist headers for all instances.static voidsetDefaultTextBackground(Color new_text_background) This sets the background of text components for all instances.voidThis sets the font for this instance.voidsetForeground(Color new_foreground) This sets the foreground color for this instance.voidsetHeadingBackground(Color heading_background) This sets the background of multilist headings for this instance.voidsetHeadingForeground(Color heading_foreground) This sets the foreground of the multilist headers for this instance.voidsetTextBackground(Color new_text_background) This sets the background color for choice text components for this instance.
-
Constructor Details
-
ContainerColorUtility
public ContainerColorUtility()This constructs and instance of the ContainerColorUtility
Supported API: true. -
ContainerColorUtility
This constructs and instance of the ContainerColorUtility and setsmyContainerto the container passed in.
Supported API: true.
-
-
Method Details
-
setContainter
This is a setter for themyContainerattribute.
Supported API: true. -
getContainer
This is the getter for themyContainerattribute.
Supported API: true. -
colorContainer
public void colorContainer()Call this method when you want to color only the instance of the container that this class is holding and its components.
Supported API: true. -
colorContainer
This is the static method that can be used to color a container with the defined colors and recursively color its components.
Supported API: true. -
color
Iterates through the container and colors the components within
Supported API: true. -
colorContents
public void colorContents()Use this method to color the contents of the container instance but not the container itself.
Supported API: true. -
colorContents
Use this static method to color the contents of the container passed in but not the container itself.
Supported API: true. -
colorContentsOfContainer
this colors the contents of the container instance but not the container itself.
Supported API: true. -
setBackground
This sets the background for this instance.
Supported API: true. -
setChoiceBackground
This sets the background color for choice boxes for this instance.
Supported API: true. -
setTextBackground
This sets the background color for choice text components for this instance.
Supported API: true. -
setForeground
This sets the foreground color for this instance.
Supported API: true. -
setFont
This sets the font for this instance.
Supported API: true. -
setCellBackground
This sets the background of multilist cells for this instance.
Supported API: true. -
setCellForeground
This sets the foreground of multilist cells for this instance.
Supported API: true. -
setHeadingBackground
This sets the background of multilist headings for this instance.
Supported API: true. -
setHeadingForeground
This sets the foreground of the multilist headers for this instance.
Supported API: true. -
getBackground
This sets the background for this instance.
Supported API: true. -
getChoiceBackground
This gets the background color for choice boxes for this instance.
Supported API: true. -
getTextBackground
This gets the background color for choice text components for this instance.
Supported API: true. -
getForeground
This gets the foreground color for this instance.
Supported API: true. -
getFont
This gets the font for this instance.
Supported API: true. -
getCellBackground
This gets the background of multilist cells for this instance.
Supported API: true. -
getCellForeground
This gets the foreground of multilist cells for this instance.
Supported API: true. -
getHeadingBackground
This gets the background of multilist headings for this instance.
Supported API: true. -
getHeadingForeground
This gets the foreground of the multilist headers for this instance.
Supported API: true. -
setDefaultBackground
This sets the background for all instances.
Supported API: true. -
setDefaultChoiceBackground
This sets the background of the choice boxes for all instances.
Supported API: true. -
setDefaultTextBackground
This sets the background of text components for all instances.
Supported API: true. -
setDefaultForeground
This sets the foreground for all instances.
Supported API: true. -
setDefaultFont
This sets the font for all instances.
Supported API: true. -
setDefaultCellBackground
This sets the background of multilist cells for all instances.
Supported API: true. -
setDefaultCellForeground
This sets the foreground of multilist cells for all instances.
Supported API: true. -
setDefaultHeadingBackground
This sets the background of multilist headers for all instances.
Supported API: true. -
setDefaultHeadingForeground
This sets the foreground of multilist headers for all instances.
Supported API: true. -
getDefaultBackground
This gets the background for all instances.
Supported API: true. -
getDefaultChoiceBackground
This gets the background of choice boxes for all instances.
Supported API: true. -
getDefaultTextBackground
This gets the background of text components for all instances.
Supported API: true. -
getDefaultForeground
This gets the foreground for all instances.
Supported API: true. -
getDefaultFont
This gets the font for all instances.
Supported API: true. -
getDefaultCellBackground
This gets the background of multilist cells for all instances.
Supported API: true. -
getDefaultCellForeground
This gets the foreground of multilist cells for all instances.
Supported API: true. -
getDefaultHeadingBackground
This gets the background of multilist headers for all instances.
Supported API: true. -
getDefaultHeadingForeground
This gets the foreground of multitlist headers for all instances.
Supported API: true.
-