oracle.cabo.ui.laf
Class LookAndFeelStyleProvider
java.lang.Object
|
+--oracle.cabo.style.cache.FileSystemStyleCache
|
+--oracle.cabo.ui.laf.LookAndFeelStyleProvider
- All Implemented Interfaces:
- StyleProvider
- public class LookAndFeelStyleProvider
- extends FileSystemStyleCache
An extension of the FileSystemStyleCache which merges styles
provided by the LookAndFeel with styles provided by a
custom style sheet.
Constructor Summary |
protected |
LookAndFeelStyleProvider(LookAndFeel lookAndFeel,
java.lang.String customStyleSheetPath,
java.lang.String targetDirectoryPath)
Creates LookAndFeelStyleProvider instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LookAndFeelStyleProvider
protected LookAndFeelStyleProvider(LookAndFeel lookAndFeel,
java.lang.String customStyleSheetPath,
java.lang.String targetDirectoryPath)
throws java.lang.IllegalArgumentException
- Creates LookAndFeelStyleProvider instance.
Only subclasses should call this method. All other
clients should use getLookAndFeelStyleProvider().
- Parameters:
lookAndFeel
- The LookAndFeel which defines the
look and feel-specific style information for this
StyleProvider.customStyleSheetPath
- The full file system path
to an XSS file which defines custom styles for this
StyleProvider.targetDirectoryPath
- The full file system path
to the directory where generated CSS files will be
stored.- Throws:
java.lang.IllegalArgumentException
- This exception is thrown
if no LookAndFeel is null, or if either of the
paths are invalid.- See Also:
LookAndFeelStyleProvider(oracle.cabo.ui.laf.LookAndFeel, java.lang.String, java.lang.String)
getLookAndFeelStyleProvider
public static StyleProvider getLookAndFeelStyleProvider(RenderingContext context,
java.lang.String customStyleSheetPath,
java.lang.String targetDirectoryPath)
throws java.lang.IllegalArgumentException
- Returns a shared instance of the LookAndFeelStyleProvider.
The StyleProvider combines styles from two sources. First,
styles are pulled from the current LookAndFeel, which is
retrieved from the RenderingContext. Then, styles are pulled
from the custom style sheet, as identified by the (possibly null)
customStyleSheetPath argument. Styles specified by the custom
style sheet take precedence over styles provided by the
LookAndFeel.
- Parameters:
context
- The current RenderingContext, which provides
access to the current LookAndFeel.customStyleSheetPath
- The full file system path of
a custom XSS style sheet document. This argument
may be null if no custom style sheet has been provided.
However, if this argument is non-null, it must be a
valid path to an XSS file. Otherwise, an
IllegalArgumentException is thrown.targetDirectoryPath
- The full file system path of the
directory where generated CSS files are stored.
If the directory does not exist and cannot be
created, an IllegalArgumentException is thrown.- Throws:
java.lang.IllegalArgumentException
- This exception is thrown
if no LookAndFeel is found, or if either of the
paths are invalid.
createStyleSheetDocument
protected StyleSheetDocument createStyleSheetDocument(StyleContext context)
- Override of FileSystemStyleCache.createStyleSheetDocument().
Merges the LookAndFeel's styles with custom styles to
produce a single StyleSheetDocument
- Overrides:
createStyleSheetDocument
in class FileSystemStyleCache
- Following copied from class:
oracle.cabo.style.cache.FileSystemStyleCache
- Parameters:
context
- The StyleContext- Returns:
- The StyleSheetDocument which defines the styles
for this StyleProvider.
hasSourceDocumentChanged
protected boolean hasSourceDocumentChanged(StyleContext context)
- Override of FileSystemStyleCache.hasSourceDocumentChanged()
which checks for changes to the LookAndFeel's style sheet.
- Overrides:
hasSourceDocumentChanged
in class FileSystemStyleCache
- Following copied from class:
oracle.cabo.style.cache.FileSystemStyleCache
- Returns:
- true if the underlying source style sheets have been
modified, false otherwise.
getTargetStyleSheetName
protected java.lang.String getTargetStyleSheetName(StyleContext context,
StyleSheetDocument document)
- Override of FileSystemStyleCache.getTargetStyleSheetName().
- Overrides:
getTargetStyleSheetName
in class FileSystemStyleCache
- Following copied from class:
oracle.cabo.style.cache.FileSystemStyleCache
- Parameters:
context
- The StyleContextdocument
- The StyleSheetDocument which provides the styles