// Toggle Editability @Override public void toggleEditability(int row, AttributeTableModel model) { AttributeContainer node = view.tree; if (node == null) { return; } String key = (String) model.keys.get(row); Object oldAndNewValue = node.getAttribute(key); boolean oldReadOnly = node.isReadOnly(key); boolean readOnly = !oldReadOnly; boolean oldValue = true; ImageIcon isReadOnly = (ImageIcon) model.getValueAt(row, 1); if (isReadOnly == OutlineEditableIndicator.ICON_IS_NOT_PROPERTY) { oldValue = true; } else { oldValue = false; } // boolean oldValue = ((Boolean) model.getValueAt(row, 1)).booleanValue(); boolean newValue = !oldValue; model.readOnly.set(row, new Boolean(newValue)); node.setReadOnly(key, newValue); OutlinerDocument doc = view.tree.getDocument(); doc.setModified(true); // undo Undoable undoable = new UndoableDocumentAttributeChange( view.tree, key, oldAndNewValue, oldReadOnly, key, oldAndNewValue, readOnly); undoable.setName("Toggle Document Attribute Editability"); doc.getUndoQueue().add(undoable); model.fireTableDataChanged(); }