コード例 #1
0
    public void setUpdatedValueAt(Object newValue, int row, int column) {
      DuplicatedAttributeInfo attributeInfo = duplicatedAttributes.get(row);
      if (column == ATTRIBUTE_NAME) {
        attributeInfo.setNewName(newValue.toString());
        attributeInfo.setAction(RENAME_ACTION);
        // TODO: add warn if new valuew equals the old one or name
        // equals to another attribute name.
        this.fireTableDataChanged();
      }

      if (column == ACTION) {
        attributeInfo.setAction(newValue.toString());
      }
    }
コード例 #2
0
 public Object getValueAt(int row, int col) {
   DuplicatedAttributeInfo attributeInfo = duplicatedAttributes.get(row);
   switch (col) {
     case ATTRIBUTE_NAME:
       return attributeInfo.getNewName();
     case PARENT_TYPE:
       return attributeInfo.getParentType();
     case TYPE:
       return attributeInfo.getType();
     case ACTION:
       return attributeInfo.getAction();
   }
   return "";
 }
コード例 #3
0
 private void applyChanges() {
   for (DuplicatedAttributeInfo attributeInfo : duplicatedAttributes) {
     if (attributeInfo.getAction().equals(DELETE_ACTION)) {
       entity.removeAttribute(attributeInfo.getName());
     }
     if (attributeInfo.getAction().equals(RENAME_ACTION)) {
       ProjectUtil.setAttributeName(
           entity.getAttribute(attributeInfo.getName()), attributeInfo.getNewName());
     }
   }
 }