コード例 #1
0
 /**
  * Sets the current value of the tag "except". Removes the tag is {@code value} is null or
  * consists of white space only.
  *
  * @param value the new value for 'except'
  */
 public void setExcept(ExceptValueModel value) {
   if (value == null || value.getValue().equals("")) {
     if (tagEditorModel.get("except") != null) {
       tagEditorModel.delete("except");
       setChanged();
       notifyObservers();
     }
     return;
   }
   TagModel tag = tagEditorModel.get("except");
   if (tag == null) {
     tagEditorModel.prepend(new TagModel("except", value.getValue()));
     setChanged();
     notifyObservers();
   } else {
     if (!tag.getValue().equals(value.getValue())) {
       tag.setValue(value.getValue().trim());
       setChanged();
       notifyObservers();
     }
   }
 }
コード例 #2
0
 /**
  * Replies the current value of the tag "except", or the empty string if the tag doesn't exist.
  */
 public ExceptValueModel getExcept() {
   TagModel tag = tagEditorModel.get("except");
   if (tag == null) return new ExceptValueModel("");
   return new ExceptValueModel(tag.getValue());
 }