Ejemplo n.º 1
0
 /**
  * Sets or removes a property of this rule.
  *
  * @param key the name of the property to set
  * @param value the value of the property or <code>null</code>
  */
 public void setProperty(CssPropertyKey key, CssDeclarationValue value) {
   if (value == null) {
     properties.remove(key);
   } else {
     properties.put(key, value);
   }
   for (CssRuleContentListener listener :
       contentListeners.toArray(new CssRuleContentListener[contentListeners.size()])) {
     listener.propertyChanged(this, key);
   }
 }
 /**
  * Sets the rule whose properties should be forwarded.
  *
  * @param rule the rule, can be <code>null</code>
  */
 public void setRule(CssRuleContent rule) {
   if (this.rule != null && !listeners.isEmpty()) {
     this.rule.removeRuleContentListener(forwardListener);
   }
   this.rule = rule;
   if (this.rule != null && !listeners.isEmpty()) {
     this.rule.addRuleContentListener(forwardListener);
     for (CssRuleContentListener listener : listeners()) {
       listener.propertiesChanged(this);
     }
   }
 }
 @Override
 public void propertiesChanged(CssRuleContent source) {
   for (CssRuleContentListener listener : listeners()) {
     listener.propertiesChanged(WrappedCssRuleContent.this);
   }
 }
 @Override
 public void propertyChanged(CssRuleContent source, CssPropertyKey key) {
   for (CssRuleContentListener listener : listeners()) {
     listener.propertyChanged(WrappedCssRuleContent.this, key);
   }
 }