|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This StyleSheet interface represents a collection of style information that can be applied to a Component and its children.
Method Summary | |
void |
addGroup(StyleSheetGroup styleSheetGroup)
Deprecated. StyleSheetGroup has been deprecated and will be removed in the next version of EchoPoint. Use the new attributed identifier on the Component from now on, eg component.setIdentifier("stylegroup=xxx;"); |
void |
applyTo(nextapp.echo.Component c)
This method applies the StyleSheet to the given Component c and all of its children. |
void |
applyTo(nextapp.echo.Component c,
boolean listenForFutureChildren)
This method applies the StyleSheet to the given Component c and all of its children. |
void |
applyTo(nextapp.echo.EchoInstance instance)
This method applies the StyleSheet to the Windows of the given EchoInstance and all of their children. |
void |
applyTo(nextapp.echo.EchoInstance instance,
boolean listenForFutureChildren)
This method applies the StyleSheet to the Windows of the given EchoInstance and all of their children. |
void |
loadStyleSheet(java.io.Reader styleSheetReader)
This method causes the StyleSheet to load and parse the style information contained in the given Reader object. |
void |
stopListeningTo(nextapp.echo.Component c)
This stops the StyleSheet from listening for Component.CHILDREN_PROPERTY_CHANGED events on the given Component c. |
void |
stopListeningTo(nextapp.echo.EchoInstance instance)
This stops the StyleSheet from listening for EchoInstance.WINDOWS_CHANGED_PROPERTY and Component.CHILDREN_PROPERTY_CHANGED events on the given EchoInstance. |
Method Detail |
public void loadStyleSheet(java.io.Reader styleSheetReader) throws StyleSheetParseException
styleSheetReader
- - the Reader containg style sheet information
StyleSheetParseException
- - if the data cannot be parsedpublic void addGroup(StyleSheetGroup styleSheetGroup)
If it can , the StyleSheet is expected to apply Styles to Components within this group, based on the StyleSheetGroup name.
styleSheetGroup
- - the stylesheet group to addpublic void applyTo(nextapp.echo.Component c)
This method can throw a StyleSheetInvalidValueException if a value of the wrong type is stored in a Style object. The StyleSheet is expected to catch the ClassCastException that might be thrown and then rethrow it as a StyleSheetInvalidValueException.
c
- - the component to apply the style sheet topublic void applyTo(nextapp.echo.Component c, boolean listenForFutureChildren)
If listenForFutureChildren is true, then the StyleSheet is expected to listen for Component.CHILDREN_CHANGED_PROPERTY property change events and apply the StyleSheet to any new children.
The can be done by called the Component.addPropertyChangeListener
This method can throw a StyleSheetInvalidValueException if a value of the wrong type is stored in a Style object. The StyleSheet is expected to catch the ClassCastException that might be thrown and then rethrow it as a StyleSheetInvalidValueException.
c
- - the component to apply the style sheet tolistenForFutureChildren
- - whether to listen for future childrenpublic void applyTo(nextapp.echo.EchoInstance instance)
Be aware when using this function in EchoInstance.init(). Add that stage there are no Windows in the EchoInstance and it does not fire any events once it has finished, and hence the StyleSheet will not be applied. You can get around this issue by applying the StyleSheet to the Window object you must return in EchoInstance.init() as well as the EchoInstance itself. The code might look like this :
public nextapp.echo.Window init() { Window window = new Window(); ... ... try { styleSheet.applyTo(this,true); styleSheet.applyTo(window); } catch (StyleSheetParseException e) { .... } return window; }
This method can throw a StyleSheetInvalidValueException if a value of the wrong type is stored in a Style object. The StyleSheet is expected to catch the ClassCastException that might be thrown and then rethrow it as a StyleSheetInvalidValueException.
instance
- - the EchoInstance to apply the style sheet topublic void applyTo(nextapp.echo.EchoInstance instance, boolean listenForFutureChildren)
If listenForFutureChildren is true, then the StyleSheet is expected to listen for EchoInstance.WINDOWS_CHANGED_PROPERTY and Component.CHILDREN_CHANGED_PROPERTY property change events and apply the StyleSheet to any new children.
Be aware when using this function in EchoInstance.init(). Add that stage there are no Windows in the EchoInstance and it does not fire any events once it has finished, and hence the StyleSheet will not be applied. You can get around this issue by applying the StyleSheet to the Window object you must return in EchoInstance.init() as well as the EchoInstance itself. The code might look like this :
public nextapp.echo.Window init() { Window window = new Window(); ... ... try { styleSheet.applyTo(this,true); styleSheet.applyTo(window); } catch (StyleSheetParseException e) { .... } return window; }
This method can throw a StyleSheetInvalidValueException if a value of the wrong type is stored in a Style object. The StyleSheet is expected to catch the ClassCastException that might be thrown and then rethrow it as a StyleSheetInvalidValueException.
instance
- - the EchoInstance to apply the style sheet tolistenForFutureChildren
- - whether to listen for future childrenpublic void stopListeningTo(nextapp.echo.Component c)
c
- - the component to stop listening for children onpublic void stopListeningTo(nextapp.echo.EchoInstance instance)
instance
- - the EchoINstance to stop listening for children on
|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |