public abstract class AbstractTopLevelContainerNode extends AbstractResourceNavTreeNode implements DesignableWorkspaceListener, ProjectChangeListener
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractTopLevelContainerNode.SendToAction |
protected class |
AbstractTopLevelContainerNode.SendToMenu |
AbstractNavTreeNode.DeleteReason, AbstractNavTreeNode.PopupAction, AbstractNavTreeNode.ResourceChangeListener
ProjectChangeListener.ResourceModification
Modifier and Type | Field and Description |
---|---|
protected TopLevelContainer |
container |
protected DesignerContext |
context |
protected java.util.UUID |
parentFolder |
protected long |
resourceId |
protected ProjectScope |
scope |
protected com.google.common.base.Supplier<AbstractTopLevelContainerNode.SendToMenu> |
sendToMenu |
protected VisionDesignerImpl |
vision |
protected WindowWorkspace |
workspace |
bold, children, childrenLoaded, copyAction, cutAction, deleteAction, depth, icon, italic, log, model, name, NAME_PATTERN, parent, pasteAction, protectedAction, protectedMenuItem, renameAction, selectionModel, text, thumbnail, tooltip
Modifier | Constructor and Description |
---|---|
protected |
AbstractTopLevelContainerNode(VisionDesignerImpl fpmi,
ProjectResource resource,
ProjectScope scope) |
Modifier and Type | Method and Description |
---|---|
void |
addBadges(BadgeTreeCellRenderer renderer) |
protected abstract void |
addListeners(TopLevelContainer container) |
protected boolean |
alterName(java.lang.String newTextValue) |
boolean |
canCopy(java.util.List<AbstractNavTreeNode> selectedChildren)
Can this edit action handler handle the copy action, given its current selection? Note that if this and
AbstractNavTreeNode.canDelete(java.util.List) both return true, the cut action will also be enabled. |
boolean |
canDelete(java.util.List<AbstractNavTreeNode> selectedChildren)
Can this edit action handler handle the delete action, given its current selection? Note that if this and
AbstractNavTreeNode.canCopy(java.util.List) both return true, the cut action will also be enabled. |
boolean |
canPaste(java.util.List<AbstractNavTreeNode> selectedChildren,
java.awt.datatransfer.Transferable data)
Can this action handler handle a paste given the data flavors currently available in the clipboard? data
may be null.
|
boolean |
confirmDelete(java.util.List<? extends AbstractNavTreeNode> selectedChildren)
Used to confirm the delete.
|
void |
containerClosed(DesignableContainer container) |
void |
containerOpened(DesignableContainer container) |
void |
containerSelected(DesignableContainer container) |
java.awt.datatransfer.Transferable |
doCopy(java.util.List<? extends AbstractNavTreeNode> selectedChildren)
Called when the copy action is performed.
|
java.awt.datatransfer.Transferable |
doCut(java.util.List<? extends AbstractNavTreeNode> selectedChildren)
Called when the cut action is performed.
|
void |
doDelete(java.util.List<? extends AbstractNavTreeNode> selectedChildren,
AbstractNavTreeNode.DeleteReason reason)
Called when the delete action is performed, if confirmDelete returned true
|
boolean |
doPaste(java.util.List<? extends AbstractNavTreeNode> selectedChildren,
java.awt.datatransfer.Transferable clipboardContents,
boolean isDrop)
Called when the paste action is performed
|
protected abstract AbstractNavTreeNode |
findChild(java.awt.Component c) |
boolean |
getAllowsChildren() |
ProjectResource |
getProjectResource()
The ProjectResource that this node represents
|
long |
getResourceId() |
protected abstract java.util.UUID |
getRootFolderUUID() |
java.lang.String |
getText()
The text that will be used to render the node
|
VisionDesignerInterface |
getVision() |
void |
install(AbstractNavTreeNode parent) |
boolean |
isContainerOpen() |
boolean |
isEditable()
Override this and return true if you want your node's text to be editable.
|
boolean |
isEditActionHandler()
Override to return true if you want this node to be an edit action handler for its children.
|
void |
itemSelectionChanged(java.util.List<javax.swing.JComponent> newSelection) |
protected boolean |
matches(DesignableContainer container) |
void |
onChildrenSelected(java.util.List<javax.swing.tree.TreePath> paths)
Called when child nodes (deep) are selected under this node.
|
void |
onEdit(java.lang.String newTextValue)
Called after this node has been edited in the tree.
|
void |
onSelected()
Called when this node is selected in the tree
|
protected DesignerProjectContext |
projectCtx()
Returns the project context (local vs global) that this resource belongs to
|
void |
projectResourceModified(ProjectResource resource,
ProjectChangeListener.ResourceModification changeType)
Notifies listeners when modules from this designer session alter the current project.
|
void |
projectUpdated(Project diff)
Notifies the listener that the project has been updated externally, by the result of a File-Update or a Save.
|
protected abstract void |
removeListeners(TopLevelContainer container) |
protected void |
setContainer(TopLevelContainer container,
boolean notify) |
void |
uninstall()
Called when the node is removed from the tree.
|
gatherChildrenIds, isProtected, isProtectedEnabled, selectChild, setProtected, setupEditActions
addEditActions, canDrag, canDrop, checkChildren, children, createProjectCopy, debug, debug, dispatchSelectionEvent, expand, findChild, findCommonEditActionHandler, findDropHandler, findEditActionHandler, forceChildrenReload, getChildAt, getChildCount, getClipboard, getCommonEditActionHandler, getDepth, getExpandedIcon, getIcon, getIndex, getModel, getName, getParent, getSelectionModel, getSortOrder, getThumbnail, getTooltip, getWorkspaceName, initPopupMenu, isBold, isItalic, isLeaf, isSelected, isValidName, iterator, loadChildren, newLogger, notifyChildNameChanged, onDoubleClick, pathToRoot, recreate, refresh, reload, select, select, setBold, setChildren, setIcon, setItalic, setName, setText, setThumbnail, setTooltip, showPopup, showPopupMenu, toString, uninstallChildren, useThumbnailTooltip
protected VisionDesignerImpl vision
protected WindowWorkspace workspace
protected DesignerContext context
protected long resourceId
protected ProjectScope scope
protected java.util.UUID parentFolder
protected TopLevelContainer container
protected com.google.common.base.Supplier<AbstractTopLevelContainerNode.SendToMenu> sendToMenu
protected AbstractTopLevelContainerNode(VisionDesignerImpl fpmi, ProjectResource resource, ProjectScope scope)
protected DesignerProjectContext projectCtx()
AbstractResourceNavTreeNode
projectCtx
in class AbstractResourceNavTreeNode
public VisionDesignerInterface getVision()
public void install(AbstractNavTreeNode parent)
install
in class AbstractResourceNavTreeNode
public void uninstall()
AbstractNavTreeNode
uninstall
in class AbstractResourceNavTreeNode
public void addBadges(BadgeTreeCellRenderer renderer)
addBadges
in class AbstractNavTreeNode
public java.lang.String getText()
AbstractNavTreeNode
getText
in class AbstractNavTreeNode
public boolean isEditable()
AbstractNavTreeNode
AbstractNavTreeNode.onEdit(String)
isEditable
in class AbstractNavTreeNode
public void onEdit(java.lang.String newTextValue)
AbstractNavTreeNode
onEdit
in class AbstractNavTreeNode
protected boolean alterName(java.lang.String newTextValue)
protected abstract void removeListeners(TopLevelContainer container)
protected abstract void addListeners(TopLevelContainer container)
public void projectResourceModified(ProjectResource resource, ProjectChangeListener.ResourceModification changeType)
ProjectChangeListener
projectResourceModified
in interface ProjectChangeListener
public void projectUpdated(Project diff)
ProjectChangeListener
projectUpdated
in interface ProjectChangeListener
protected boolean matches(DesignableContainer container)
public void containerClosed(DesignableContainer container)
containerClosed
in interface DesignableWorkspaceListener
public void containerOpened(DesignableContainer container)
containerOpened
in interface DesignableWorkspaceListener
public void containerSelected(DesignableContainer container)
containerSelected
in interface DesignableWorkspaceListener
public void itemSelectionChanged(java.util.List<javax.swing.JComponent> newSelection)
itemSelectionChanged
in interface DesignableWorkspaceListener
public void onSelected()
AbstractNavTreeNode
onSelected
in class AbstractNavTreeNode
public void onChildrenSelected(java.util.List<javax.swing.tree.TreePath> paths)
AbstractNavTreeNode
onChildrenSelected
in class AbstractNavTreeNode
paths
- the children selected when the parent node is selectedprotected abstract java.util.UUID getRootFolderUUID()
protected abstract AbstractNavTreeNode findChild(java.awt.Component c)
protected void setContainer(TopLevelContainer container, boolean notify)
public boolean getAllowsChildren()
getAllowsChildren
in interface javax.swing.tree.TreeNode
getAllowsChildren
in class AbstractNavTreeNode
public boolean isContainerOpen()
public ProjectResource getProjectResource()
AbstractResourceNavTreeNode
getProjectResource
in class AbstractResourceNavTreeNode
public long getResourceId()
public boolean canCopy(java.util.List<AbstractNavTreeNode> selectedChildren)
AbstractNavTreeNode
AbstractNavTreeNode.canDelete(java.util.List)
both return true, the cut action will also be enabled.canCopy
in class AbstractNavTreeNode
public boolean canDelete(java.util.List<AbstractNavTreeNode> selectedChildren)
AbstractNavTreeNode
AbstractNavTreeNode.canCopy(java.util.List)
both return true, the cut action will also be enabled.canDelete
in class AbstractNavTreeNode
public boolean canPaste(java.util.List<AbstractNavTreeNode> selectedChildren, java.awt.datatransfer.Transferable data)
AbstractNavTreeNode
canPaste
in class AbstractNavTreeNode
public java.awt.datatransfer.Transferable doCopy(java.util.List<? extends AbstractNavTreeNode> selectedChildren)
AbstractNavTreeNode
doCopy
in class AbstractNavTreeNode
Transferable
, or null if the copy failed. Will be added to
the system clipboard.public java.awt.datatransfer.Transferable doCut(java.util.List<? extends AbstractNavTreeNode> selectedChildren)
AbstractNavTreeNode
doCut
in class AbstractNavTreeNode
Transferable
, or null if the cut failed. Will be added to the
system clipboard.public void doDelete(java.util.List<? extends AbstractNavTreeNode> selectedChildren, AbstractNavTreeNode.DeleteReason reason)
AbstractNavTreeNode
doDelete
in class AbstractNavTreeNode
public boolean confirmDelete(java.util.List<? extends AbstractNavTreeNode> selectedChildren)
AbstractNavTreeNode
confirmDelete
in class AbstractNavTreeNode
public boolean doPaste(java.util.List<? extends AbstractNavTreeNode> selectedChildren, java.awt.datatransfer.Transferable clipboardContents, boolean isDrop)
AbstractNavTreeNode
doPaste
in class AbstractNavTreeNode
clipboardContents
- The current contents of the clipboard to paste.isDrop
- Indicates whether this paste originated from a drop action. If false, originated from a
keyboard or menu paste shortcut.public boolean isEditActionHandler()
AbstractNavTreeNode
isEditActionHandler
in class AbstractNavTreeNode