TUM CCSM Commons

edu.tum.cs.commons.html
Class CSSManagerBase

java.lang.Object
  extended by edu.tum.cs.commons.html.CSSManagerBase

public abstract class CSSManagerBase
extends java.lang.Object

This class is used for managing cascading style sheets. It keeps track of all declaration blocks and selectors used.

Version:
$Rev: 26283 $
Author:
hummelb, $Author: juergens $
Rating:
GREEN Hash: D0645454B949512DFB3949CF2F8C7055

Constructor Summary
CSSManagerBase()
           
 
Method Summary
 void addDefaultDeclaration(EHTMLElement element, CSSDeclarationBlock block)
          Adds a single selector and its block to this manager.
 void addDefaultDeclaration(EHTMLElement element, ECSSPseudoClass pseudoClass, CSSDeclarationBlock block)
          Adds a single selector and its block to this manager.
protected  java.lang.String generateCSSClassName()
          Generates a suitable name for a CSS class.
 java.lang.String getCSSClassName(CSSDeclarationBlock block)
          Returns the name of the CSS class used for this block.
 boolean hasDefaultDeclaration(EHTMLElement element)
          Returns whether there is a default declaration for the given element.
 boolean hasDefaultDeclaration(EHTMLElement element, ECSSPseudoClass pseudoClass)
          Returns whether there is a default declaration for the given element.
protected  void writeOut(java.io.PrintStream ps)
          Write all selectors with their blocks to the given stream.
protected  void writeOutDeclarations(java.io.PrintStream ps)
          Write out declarations.
protected  void writeOutDefaultDeclarations(java.io.PrintStream ps)
          Write out default declarations for element (i.e. without specific class).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSSManagerBase

public CSSManagerBase()
Method Detail

hasDefaultDeclaration

public boolean hasDefaultDeclaration(EHTMLElement element)
Returns whether there is a default declaration for the given element.


hasDefaultDeclaration

public boolean hasDefaultDeclaration(EHTMLElement element,
                                     ECSSPseudoClass pseudoClass)
Returns whether there is a default declaration for the given element.


addDefaultDeclaration

public final void addDefaultDeclaration(EHTMLElement element,
                                        CSSDeclarationBlock block)
Adds a single selector and its block to this manager.


addDefaultDeclaration

public void addDefaultDeclaration(EHTMLElement element,
                                  ECSSPseudoClass pseudoClass,
                                  CSSDeclarationBlock block)
Adds a single selector and its block to this manager.


getCSSClassName

public java.lang.String getCSSClassName(CSSDeclarationBlock block)
Returns the name of the CSS class used for this block. If the block is not yet known, it is registered with this manager.


generateCSSClassName

protected java.lang.String generateCSSClassName()
Generates a suitable name for a CSS class. This may be overridden by subclasses. However it must be made sure, that the class names returned are unique and do not overlap with HTML element names.


writeOut

protected void writeOut(java.io.PrintStream ps)
Write all selectors with their blocks to the given stream. The format is the one usually used in CSS files. This merely calls writeOutDefaultDeclarations(PrintStream) and writeOutDeclarations(PrintStream).


writeOutDefaultDeclarations

protected void writeOutDefaultDeclarations(java.io.PrintStream ps)
Write out default declarations for element (i.e. without specific class).


writeOutDeclarations

protected void writeOutDeclarations(java.io.PrintStream ps)
Write out declarations.


TUM CCSM Commons

TUM CCSM Commons - 2.7