Oracle Data-aware Controls Reference

oracle.dacf.style
Class Style

java.lang.Object
  extended byoracle.dacf.style.Style
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, java.beans.PropertyChangeListener

public class Style
extends java.lang.Object
implements java.lang.Cloneable, java.beans.PropertyChangeListener

the Style class defines a Style.

A Style consists of StyleElements and a Style holds a reference to every component using this Style. A Style is responsible for the following tasks.

Version:
PUBLIC

Constructor Summary
Style()
          Constructor
Style(java.lang.String name)
          Constructor
Style(java.lang.String name, Style parentStyle)
          Constructor used when you choose "Create a Style using...."
Style(java.lang.String name, Style style, boolean parent)
          Constructor used when you choose "Create a Style as...." with boolean false
 
Method Summary
 void _setOverwriteStyleElements(StyleElement[] styleelements, java.awt.Component component)
          Overwrites the StyleElements passed in as for the given component.
 void addElement(StyleElement styleElement)
          Adds a Style element to this style
 void addPropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
          A PropertyChange will get fired when a StyleElement changes, or all StyleElements are updated
 java.lang.Object clone()
          implementation of Cloneable interface
 boolean compare(Style style)
          Returns true if the 2 Styles define the same properties.
 void copy(Style style)
          copies the Style definition to this style
 void dumpStyle()
           
 Style[] getChildren()
          returns all the child styles in an array
 java.lang.Object[] getComponents()
          returns an array with references to all components currently using this Style
 java.lang.String getDescription()
          Returns description of this Style
 java.lang.String getName()
          Returns name of this Style
 StyleElement[] getOverwriteStyleElements(java.awt.Component component)
          Retrieves the StyleElements that are overwritten as an array.
 StyleElement[] getOverwriteStyleElements(java.lang.String name)
          Retrieves the StyleElements that are overwritten as an array.
 Style getParent()
          returns the parent style
 StyleElement[] getParentStyleElements()
          Retrieves the ParentStyle's Style table as an array.
 java.lang.String getParentStyleName()
          Returns name of its Parent Style
 java.lang.Object getParentValue(java.lang.String property)
          get the ParentStyle's value of a certain property.
 StyleElement getStyleElement(java.lang.String property)
          Returns the StyleElement matching this Property name
 StyleElement[] getStyleElements()
          Retrieves the Style table as an array.
 boolean hasOverwriteStyleElements()
          Check if this style has overwrites defined.
 boolean isBaseStyle()
          Returns true if this Style is a base Style (has children, but no parent)
 void propertyChange(java.beans.PropertyChangeEvent evt)
          Implements PropertyChangeListener
 void removePropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
          A PropertyChange will get fired when a StyleElement changes, or all StyleElements are updated
 void setDescription(java.lang.String description)
          sets description of this Style
 void setName(java.lang.String name)
          sets name of this Style
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Style

public Style()
Constructor


Style

public Style(java.lang.String name)
Constructor


Style

public Style(java.lang.String name,
             Style parentStyle)
Constructor used when you choose "Create a Style using...."


Style

public Style(java.lang.String name,
             Style style,
             boolean parent)
Constructor used when you choose "Create a Style as...." with boolean false

Parameters:
name - the new style name
parent - indicates if subclass or not
Method Detail

clone

public java.lang.Object clone()
implementation of Cloneable interface


copy

public void copy(Style style)
copies the Style definition to this style


compare

public boolean compare(Style style)
Returns true if the 2 Styles define the same properties. return true if compare determines Styles are equal.


addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
A PropertyChange will get fired when a StyleElement changes, or all StyleElements are updated

Parameters:
propertyChangeListener - the listener to be added

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener propertyChangeListener)
A PropertyChange will get fired when a StyleElement changes, or all StyleElements are updated

Parameters:
propertyChangeListener - the listener to be removed

setName

public void setName(java.lang.String name)
sets name of this Style

Parameters:
name - Name this Style.

getName

public java.lang.String getName()
Returns name of this Style

Returns:
StyleName Name this Style.

setDescription

public void setDescription(java.lang.String description)
sets description of this Style

Parameters:
description - Description this Style.

getDescription

public java.lang.String getDescription()
Returns description of this Style

Returns:
the Description.

getParentStyleName

public java.lang.String getParentStyleName()
Returns name of its Parent Style

Returns:
StyleName Name its Parent Style.

addElement

public void addElement(StyleElement styleElement)
Adds a Style element to this style


getStyleElements

public StyleElement[] getStyleElements()
Retrieves the Style table as an array. The array returned copies of the Style Elements. This allows us to update Style Elements in the application in a controlled synchronized fashion.

Returns:
array of Style Elements

getParentStyleElements

public StyleElement[] getParentStyleElements()
Retrieves the ParentStyle's Style table as an array. This allows editors to emulate the setting of _isParentValue in cache.

Returns:
array of Style Elements

getOverwriteStyleElements

public StyleElement[] getOverwriteStyleElements(java.awt.Component component)
Retrieves the StyleElements that are overwritten as an array. This allows editors to get the StyleElements and the StyleElement overwrites for a component as 2 seperate lists. Both updates are seperate as well.

Parameters:
component - the component you request the override values for
Returns:
array of Style Elements or null if there are no matching overwrites for this specific component

getOverwriteStyleElements

public StyleElement[] getOverwriteStyleElements(java.lang.String name)
Retrieves the StyleElements that are overwritten as an array. This allows editors to get the StyleElements and the StyleElement overwrites for a component as 2 seperate lists. Both updates are seperate as well.

Parameters:
name - the component name you request the override values for
Returns:
array of Style Elements or null if there are no matching overwrites for this specific component

_setOverwriteStyleElements

public void _setOverwriteStyleElements(StyleElement[] styleelements,
                                       java.awt.Component component)
Overwrites the StyleElements passed in as for the given component.

Parameters:
styleelements - The collection of style elements.
component - the component that overrides

hasOverwriteStyleElements

public boolean hasOverwriteStyleElements()
Check if this style has overwrites defined.


getParent

public Style getParent()
returns the parent style


getChildren

public Style[] getChildren()
returns all the child styles in an array


getComponents

public java.lang.Object[] getComponents()
returns an array with references to all components currently using this Style

Returns:
components currently using this Style

isBaseStyle

public boolean isBaseStyle()
Returns true if this Style is a base Style (has children, but no parent)


getParentValue

public java.lang.Object getParentValue(java.lang.String property)
get the ParentStyle's value of a certain property.

Parameters:
property - property name

getStyleElement

public StyleElement getStyleElement(java.lang.String property)
Returns the StyleElement matching this Property name

Parameters:
property - name of the property we are looking for
Returns:
the StyleElement requested

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Implements PropertyChangeListener

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
evt - the PropertyChangeEvent

dumpStyle

public void dumpStyle()

Oracle Data-aware Controls Reference

 

Copyright © 1997, 2003, Oracle. All rights reserved.