ilog.views.customizer.styling
Class IlvComponentCSSAdapter

java.lang.Object
  extended by ilog.views.customizer.styling.IlvComponentCSSAdapter

public abstract class IlvComponentCSSAdapter
extends Object

This class is the base class of all component CSS adapters. The component CSS adapters allows to adapt a stylable component such as ilog.views.chart.IlvChart to a customizer that customizes the CSS of the component. You typically use a subclass of this class, for instance the class ilog.views.chart.customizer.IlvChartCSSAdapter:

 IlvChart chart = ...
 IlvChartCSSAdapter adapter = new IlvChartCSSAdapter(chart);
 IlvCSSRule[] rules = adapter.getRules(false);
 

Since:
JViews 7.5

Constructor Summary
protected IlvComponentCSSAdapter(Object internal)
          Constructs a new component CSS adapter.
 
Method Summary
 Object getInternal()
          Returns the internal implementation object.
 IlvCSSRule getRule(String selector, boolean create)
          Returns the rule that matches the input selector.
 IlvRuleCustomizerLogic getRuleCustomizerLogic(IlvCSSRule rule)
          Return the rule customizer logic that matches the input rule.
 IlvRuleCustomizerLogic getRuleCustomizerLogic(String selector)
          Returns the rule customizer logic that matches the input rule.
 IlvRuleCustomizerLogic[] getRuleCustomizerLogics()
          Returns all rule customizer logics of this component CSS adapter.
 IlvCSSRule[] getRules(boolean includeDisabledRules)
          Returns the CSS rules of the component.
 void removeRule(String selector)
          Remove the rule that matches the input selector from the rule set of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvComponentCSSAdapter

protected IlvComponentCSSAdapter(Object internal)
Constructs a new component CSS adapter. You typically don't use this constructor, but use one of the subclasses of this class directly.

Method Detail

getRules

public IlvCSSRule[] getRules(boolean includeDisabledRules)
Returns the CSS rules of the component.

Parameters:
includeDisabledRules - true means to return disabled rules as well.

getRule

public IlvCSSRule getRule(String selector,
                          boolean create)
                   throws IlvStylingException
Returns the rule that matches the input selector. The input selector is a string in CSS syntax, e.g. "node:selected" or "#node127". If the parameter create is true, a new rule is created and added to the rule set if no matching rule exists yet.

Parameters:
selector - The selector string in CSS syntax.
create - true means a new rule is returned if no matching rule exists yet.
Throws:
IlvStylingException

removeRule

public void removeRule(String selector)
                throws IlvStylingException
Remove the rule that matches the input selector from the rule set of this object. The input selector is a string in CSS syntax, e.g. "node:selected" or "#node127".

Parameters:
selector - The selector string in CSS syntax.
Throws:
IlvStylingException

getRuleCustomizerLogics

public IlvRuleCustomizerLogic[] getRuleCustomizerLogics()
Returns all rule customizer logics of this component CSS adapter. A rule customizer logic is an adapter that knows how to change rules in a specific context. For instance, the mechanism to change graph layout rules of a IlvDiagrammer is different than the mechanism to change rules of graphic objects.

To know which rule customizer logic can customize a rule, use the IlvRuleCustomizerLogic.match(ilog.views.util.styling.IlvCSSRule) method.

Returns:
The rule customizer logics.

getRuleCustomizerLogic

public IlvRuleCustomizerLogic getRuleCustomizerLogic(IlvCSSRule rule)
Return the rule customizer logic that matches the input rule. A rule customizer logic is an adapter that knows how to change rules in a specific context. For instance, the mechanism to change graph layout rules of a IlvDiagrammer is different than the mechanism to change rules of graphic objects.

The returned rule customizer logic is not yet initialized with the input rule. In order to initialize the rule customizer logic, call IlvRuleCustomizerLogic.setMainRule(ilog.views.util.styling.IlvCSSRule).

Parameters:
rule - The CSS rule to be customized.
Returns:
The rule customizer logic, or null if no customizer exists that matches the rule.
See Also:
IlvRuleCustomizerLogic.match(ilog.views.util.styling.IlvCSSRule)

getRuleCustomizerLogic

public IlvRuleCustomizerLogic getRuleCustomizerLogic(String selector)
                                              throws IlvStylingException
Returns the rule customizer logic that matches the input rule. A rule customizer logic is an adapter that knows how to change rules in a specific context. For instance, the mechanism to change graph layout rules of a IlvDiagrammer is different than the mechanism to change rules of graphic objects. The input selector is a string in CSS syntax, e.g. "node:selected" or "#node127". If no rule exists with the input selector, a corresponding rule is created.

Parameters:
selector - The selector string in CSS syntax.
Throws:
IlvStylingException
See Also:
IlvRuleCustomizerLogic.setMainRule(ilog.views.util.styling.IlvCSSRule)

getInternal

public Object getInternal()
Returns the internal implementation object. This method is public for internal reasons. Do not use this method.



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