コード例 #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);
   }
 }
コード例 #2
0
 /**
  * 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);
     }
   }
 }
コード例 #3
0
 @Override
 public void propertiesChanged(CssRuleContent source) {
   for (CssRuleContentListener listener : listeners()) {
     listener.propertiesChanged(WrappedCssRuleContent.this);
   }
 }
コード例 #4
0
 @Override
 public void propertyChanged(CssRuleContent source, CssPropertyKey key) {
   for (CssRuleContentListener listener : listeners()) {
     listener.propertyChanged(WrappedCssRuleContent.this, key);
   }
 }