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()); } }
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 ""; }
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()); } } }