예제 #1
0
  // Implements AModel
  protected void updateGUI() {
    editView.setName(name);
    editView.setDescription(description);

    // visual feedback
    editView.setEditing(false, true);
    editView.setNameIsValueValid(true);
  } // END protected void updateGUI()
예제 #2
0
 // Implements AModel.
 protected void updateModel() {
   // get values from editView and trim them
   String nameV = editView.getName().trim();
   // validate where necessary
   List<String> errors = validateIt(id, nameV);
   // if validation is ok, save the new values.
   if (0 == errors.size()) {
     // validated values
     name = nameV;
     // not validated values
     description = editView.getDescription().trim();
     // save needed and reset
     sendSaveNeeded();
     updateGUI();
   }
 } // END private void updateModel()
예제 #3
0
 // Implements AItemModel
 protected void checkChangeInGUI() {
   boolean isValid = validateString(editView.getName(), 1);
   if (editView.getName().trim().equals(name)
       && (editView.getDescription().trim().equals(description))) {
     editView.setEditing(false, isValid);
   } else {
     editView.setEditing(true, isValid);
   }
   // validation
   editView.setNameIsValueValid(isValid);
 } // END protected void checkChangeInGUI()