public abstract class Editor extends DefaultMutableTreeNode
Editable
object. Editors provide methods to register
listeners that will be informed about changes occurred in its associated data
object.
The class extends DefaultMutableTreeNode
in order to
make easy to implement a tree of dependences between editor classes.Modifier and Type | Class and Description |
---|---|
static interface |
Editor.EditorListener |
protected class |
Editor.LModel |
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowCopy |
protected boolean |
allowCut |
protected boolean |
allowDelete |
protected boolean |
allowPaste |
protected static boolean |
basicActionsCreated |
protected static Editor |
clip |
protected static boolean |
clipCutted |
static EditorAction |
copyAction |
protected JTree |
currentTree |
static EditorAction |
cutAction |
static EditorAction |
deleteAction |
protected HashSet<Editor.EditorListener> |
listeners |
protected Editor.LModel |
listModel |
protected ListSelectionModel |
listSelectionModel |
static EditorAction |
moveDownAction |
static EditorAction |
moveUpAction |
static EditorAction |
pasteAction |
protected boolean |
restrictMoveToSameType |
protected DefaultTreeModel |
treeModel |
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject
Modifier and Type | Method and Description |
---|---|
void |
addEditorListener(Editor.EditorListener ls) |
boolean |
canBeParentOf(Editor e) |
boolean |
canBeSiblingOf(Editor e) |
protected boolean |
canClone() |
protected boolean |
canPasteHere() |
void |
clearActionsOwner() |
static void |
clearBasicActionsOwner() |
void |
collectData() |
boolean |
copy() |
static void |
createBasicActions(Options options) |
protected abstract void |
createChildren() |
static Editor |
createEditor(String className,
Object data,
Editor parent) |
abstract EditorPanel |
createEditorPanel(Options options) |
JTree |
createJTree() |
boolean |
cut() |
protected boolean |
delete(boolean changeSelection) |
boolean |
editData(Component parent,
Options options) |
protected static Component |
findParentForDlg(AWTEvent ev) |
void |
fireEditorDataChanged(Editor.EditorListener agent) |
Editor |
getChildByName(String name) |
protected Editor |
getClone() |
JTree |
getCurrentTree() |
abstract Class |
getEditorPanelClass() |
Editor |
getEditorParent() |
Editor |
getFirstChild(Class cl) |
Object |
getFirstObject(Class cl) |
Editor |
getFirstParent(Class cl) |
Icon |
getIcon(boolean leaf,
boolean expanded) |
AbstractListModel |
getListModel() |
ListSelectionModel |
getListSelectionModel()
Getter for property listSelectionModel.
|
int |
getNearestIndex(Editor fromChild,
boolean down) |
String |
getTitleKey() |
DefaultTreeModel |
getTreeModel() |
void |
insert(MutableTreeNode newChild,
int childIndex) |
boolean |
insertEditor(Editor e,
boolean asChild,
int index,
boolean updateSelection) |
boolean |
isModified() |
boolean |
moveDown(boolean updateSelection) |
boolean |
moveToIndex(int index,
boolean updateSelection) |
boolean |
moveUp(boolean updateSelection) |
boolean |
paste(boolean updateSelection) |
void |
remove(int childIndex) |
void |
removeEditorListener(Editor.EditorListener ls) |
void |
reselect() |
void |
select() |
void |
setActionsOwner() |
protected static void |
setClip(Editor e,
boolean cutted) |
void |
setCurrentTree(JTree currentTree) |
void |
setListSelectionModel(ListSelectionModel listSelectionModel)
Setter for property listSelectionModel.
|
void |
setModified(boolean modified) |
void |
setTreeModel(DefaultTreeModel treeModel) |
String |
toString() |
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
protected HashSet<Editor.EditorListener> listeners
protected DefaultTreeModel treeModel
protected JTree currentTree
protected ListSelectionModel listSelectionModel
protected Editor.LModel listModel
public static EditorAction moveUpAction
public static EditorAction moveDownAction
public static EditorAction copyAction
public static EditorAction cutAction
public static EditorAction pasteAction
public static EditorAction deleteAction
protected static Editor clip
protected static boolean clipCutted
protected static boolean basicActionsCreated
protected boolean restrictMoveToSameType
protected boolean allowCopy
protected boolean allowCut
protected boolean allowPaste
protected boolean allowDelete
protected Editor(Object data)
protected abstract void createChildren()
public String getTitleKey()
public boolean isModified()
public void setModified(boolean modified)
public DefaultTreeModel getTreeModel()
public void setTreeModel(DefaultTreeModel treeModel)
public void setCurrentTree(JTree currentTree)
public JTree getCurrentTree()
public JTree createJTree()
public AbstractListModel getListModel()
public void insert(MutableTreeNode newChild, int childIndex)
insert
in interface MutableTreeNode
insert
in class DefaultMutableTreeNode
public void remove(int childIndex)
remove
in interface MutableTreeNode
remove
in class DefaultMutableTreeNode
public void select()
public void reselect()
public int getNearestIndex(Editor fromChild, boolean down)
protected boolean canClone()
protected boolean delete(boolean changeSelection)
public boolean moveToIndex(int index, boolean updateSelection)
public boolean moveUp(boolean updateSelection)
public boolean moveDown(boolean updateSelection)
public boolean copy()
protected static void setClip(Editor e, boolean cutted)
public boolean cut()
public boolean canBeParentOf(Editor e)
public boolean canBeSiblingOf(Editor e)
public boolean insertEditor(Editor e, boolean asChild, int index, boolean updateSelection)
protected boolean canPasteHere()
public boolean paste(boolean updateSelection)
public Icon getIcon(boolean leaf, boolean expanded)
public Editor getEditorParent()
public abstract Class getEditorPanelClass()
public abstract EditorPanel createEditorPanel(Options options)
public String toString()
toString
in class DefaultMutableTreeNode
public static void createBasicActions(Options options)
public static void clearBasicActionsOwner()
public void setActionsOwner()
public void clearActionsOwner()
public void addEditorListener(Editor.EditorListener ls)
public void removeEditorListener(Editor.EditorListener ls)
public void fireEditorDataChanged(Editor.EditorListener agent)
public void collectData()
public ListSelectionModel getListSelectionModel()
public void setListSelectionModel(ListSelectionModel listSelectionModel)
listSelectionModel
- New value of property listSelectionModel.Copyright © 2004-15 Francesc Busquets (fbusquets@xtec.cat) & Departament d'Educació de la Generalitat de Catalunya (info@xtec.cat)
Licensed under the terms of the GNU General Public License.