ilog.views.util.styling
Interface IlvCSSRule


public interface IlvCSSRule

This interface defines the read only access to a CSS rule. Each CSS rule consists of a sequence of simple selectors that define how the rule matches the objects, and the declarations define how to set the properties of the matches objects.

For instance, the CSS rule

 node.activity[workload==5]:touched {
   x: 100;
   y: 200;
 }
 
contains the simple selector node.activity[workload==5]:touched and the declarations x: 100 and y: 200.

The full selector of a rule may contain multiple simple selectors, for instance the selector of the rule

 #graph88 < node {
   x: 100;
   y: 200;
 }
 
contains the two simple selectors #graph88 and node which matches all objects of type "node" that are children of the object with id "graph88". The transition between both simple selectors is the operator "<" which has the meaning is child in the CSS element hierarchy. The transition to a previous simple selector is stored in the simple selector that follows the previous simple selector (see IlvCSSSelector).

Since:
JViews 7.5

Method Summary
 IlvCSSDeclaration[] getCSSDeclarations()
          Returns the declarations of the rule.
 IlvCSSSelector[] getCSSSelectors()
          Returns the simple selectors of the rule.
 URL getDocumentPath()
          Returns the URL of the CSS document that contains the rule.
 int getLineNumber()
          Returns the line number of the rule in the CSS document that contains the rule.
 boolean isDisabled()
          Returns whether the rule is enabled or not.
 boolean isIdentical(Object obj)
          Returns true if this rule is equal to the input rule.
 void printCSS(PrintWriter out)
          Prints the rule using CSS syntax.
 

Method Detail

getCSSSelectors

IlvCSSSelector[] getCSSSelectors()
Returns the simple selectors of the rule. The selectors define which object match this rule. Many rules have only one simple selector. If a rule has multiple simple selectors, then they define an access path in the hierarchy of matching objects. For instance, the selectors can define that the matching object must be a descendant, child, or immediate sibling (brother) of another object. See IlvCSSSelector for details.


getCSSDeclarations

IlvCSSDeclaration[] getCSSDeclarations()
Returns the declarations of the rule. A rule may consist of multiple declarations that are applied to the objects that match the selectors of the rule.


isDisabled

boolean isDisabled()
Returns whether the rule is enabled or not.


getLineNumber

int getLineNumber()
Returns the line number of the rule in the CSS document that contains the rule. Returns -1 if the rule is not originated from parsing a source file.


getDocumentPath

URL getDocumentPath()
Returns the URL of the CSS document that contains the rule. Returns null if the rule is not originated from parsing a source file.


printCSS

void printCSS(PrintWriter out)
Prints the rule using CSS syntax.

Parameters:
out - The output print writer.

isIdentical

boolean isIdentical(Object obj)
Returns true if this rule is equal to the input rule. This compares the selectors but not the declarations. It also ignores the line number or the document path and the disabled state.



Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.