ilog.cpl.css
Class IlpMutableStyleSheet

java.lang.Object
  extended by ilog.views.util.styling.IlvMutableStyleSheet
      extended by ilog.cpl.css.IlpMutableStyleSheet

public class IlpMutableStyleSheet
extends IlvMutableStyleSheet

This is a mutable style sheet. It is designed to be used in a memory. It is possible to add, change and remove rules in the style sheet.

The stylable that uses this mutable style sheet is automatically notified of any change.

In order to set the style sheet, use for example:

 IlpMutableStyleSheet styleSheet = new IlpMutableStyleSheet(stylable);
 ...
 stylable.setStyleSheets(new String[] { styleSheet.toString() });
 ...
 styleSheet.setDeclaration(selector, property, value);
 ...
 styleSheet.removeDeclaration(selector, property);
 ...
 styleSheet.removeRule(selector);
 ...
 

In order to visit the entire contents of the style sheet, you need to:

For example:
 IlpMutableStyleSheet styleSheet = ...
 ...
 Iterator iterator1 = styleSheet.getRuleSelectors();
 while (iterator1.hasNext()) {
     String selector = (String)iterator1.next();
     Iterator iterator2 = styleSheet.getDeclaredProperties(selector);
     while (iterator2.hasNext()) {
         String property = (String)iterator2.next();
         String value = styleSheet.getDeclaration(selector, property);
         ...
     }
 }
 

Since:
JTGO 4.0
See Also:
IlpStylable, IlvMutableStyleSheet, IlvStylable.setStyleSheets(java.lang.String[])

Constructor Summary
IlpMutableStyleSheet(IlpStylable s)
          Creates a new mutable style sheet.
 
Method Summary
 int getUpdateMask()
          Returns the mask that indicates the components to be changed by this mutable style sheet.
protected  void propertyChanged()
          Notifies the stylable that the style sheet has changed.
 void setUpdateMask(int mask)
          Sets the mask that indicates the components to be changed by this mutable style sheet.
 
Methods inherited from class ilog.views.util.styling.IlvMutableStyleSheet
containsDeclaration, containsRule, getDeclaration, getDeclaredProperties, getRuleSelectors, getStylable, getUpdatedStyleSheets, isAdjusting, readStyleSheet, removeAllRules, removeDeclaration, removeRule, setAdjusting, setDeclaration, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IlpMutableStyleSheet

public IlpMutableStyleSheet(IlpStylable s)
Creates a new mutable style sheet.

Parameters:
s - The stylable that uses this style sheet.
Since:
JTGO 4.0
Method Detail

setUpdateMask

public void setUpdateMask(int mask)
Sets the mask that indicates the components to be changed by this mutable style sheet.

Parameters:
mask - Update mask.
See Also:
IlpStylable.UPDATE_COMPONENT_MASK, IlpStylable.UPDATE_OBJECTS_MASK, IlpStylable.UPDATE_ALL_MASK, IlpStylable.UPDATE_NONE_MASK

getUpdateMask

public int getUpdateMask()
Returns the mask that indicates the components to be changed by this mutable style sheet.

Returns:
Update mask
See Also:
IlpStylable.UPDATE_COMPONENT_MASK, IlpStylable.UPDATE_OBJECTS_MASK, IlpStylable.UPDATE_ALL_MASK, IlpStylable.UPDATE_NONE_MASK

propertyChanged

protected void propertyChanged()
Notifies the stylable that the style sheet has changed.

Overrides:
propertyChanged in class IlvMutableStyleSheet
Internal method or field: do not use!


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