public class ResourceNode extends AbstractResourceNavTreeNode
AbstractNavTreeNode.DeleteReason, AbstractNavTreeNode.PopupAction, AbstractNavTreeNode.ResourceChangeListener
bold, children, childrenLoaded, copyAction, cutAction, deleteAction, depth, icon, italic, log, model, name, NAME_PATTERN, parent, pasteAction, protectedAction, protectedMenuItem, renameAction, selectionModel, text, thumbnail, tooltip
Constructor and Description |
---|
ResourceNode(DesignerContext context,
TabbedResourceWorkspace workspace,
ProjectResource resource) |
Modifier and Type | Method and Description |
---|---|
protected void |
addEditActions(javax.swing.JPopupMenu menu,
java.util.List<AbstractNavTreeNode> selection)
Overloaded
AbstractNavTreeNode.addEditActions(JPopupMenu) to support
adding menu items which may require the selection, such as the Copy Path
action. |
void |
closeAndCommit() |
void |
commitIfOpen() |
ProjectResource |
getProjectResource()
The ProjectResource that this node represents
|
long |
getResourceId()
Getter for the resourceId
|
protected void |
init(ProjectResource resource) |
protected void |
initPopupMenu(javax.swing.JPopupMenu menu,
javax.swing.tree.TreePath[] paths,
java.util.List<AbstractNavTreeNode> selection,
int modifiers)
Default implementation calls setupEditActions(), and then addEditActions()
|
void |
install(AbstractNavTreeNode parent) |
boolean |
isEditable()
Override this and return true if you want your node's text to be editable.
|
void |
onDoubleClick()
Called when this node is double-clicked on.
|
void |
onEdit(java.lang.String newTextValue)
Called after this node has been edited in the tree.
|
protected void |
onEditorClosed(ResourceEditor editor) |
protected void |
onEditorOpened(ResourceEditor editor) |
protected void |
onEditorSelected(ResourceEditor editor)
Called whenever the ResourceEditor for this resource has been opened or selected in the tabbed workspace.
|
protected void |
onEditorUnselected() |
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
|
protected void |
uninstall()
Called when the node is removed from the tree.
|
gatherChildrenIds, isProtected, isProtectedEnabled, selectChild, setProtected, setupEditActions
addBadges, addEditActions, canCopy, canDelete, canDrag, canDrop, canPaste, checkChildren, children, confirmDelete, debug, debug, dispatchSelectionEvent, doCopy, doCut, doDelete, doPaste, expand, findChild, findCommonEditActionHandler, findDropHandler, findEditActionHandler, forceChildrenReload, getAllowsChildren, getChildAt, getChildCount, getClipboard, getCommonEditActionHandler, getDepth, getExpandedIcon, getIcon, getIndex, getModel, getName, getParent, getSelectionModel, getSortOrder, getText, getThumbnail, getTooltip, getWorkspaceName, isBold, isEditActionHandler, isItalic, isLeaf, isSelected, isValidName, iterator, loadChildren, newLogger, notifyChildNameChanged, onChildrenSelected, pathToRoot, recreate, refresh, reload, select, select, setBold, setChildren, setIcon, setItalic, setName, setText, setThumbnail, setTooltip, showPopup, showPopupMenu, toString, uninstallChildren, useThumbnailTooltip
public ResourceNode(DesignerContext context, TabbedResourceWorkspace workspace, ProjectResource resource)
protected void init(ProjectResource resource)
protected void uninstall()
AbstractNavTreeNode
uninstall
in class AbstractNavTreeNode
public void install(AbstractNavTreeNode parent)
install
in class AbstractNavTreeNode
protected void onEditorSelected(ResourceEditor editor)
protected void onEditorUnselected()
protected void onEditorOpened(ResourceEditor editor)
protected void onEditorClosed(ResourceEditor editor)
public ProjectResource getProjectResource()
AbstractResourceNavTreeNode
getProjectResource
in class AbstractResourceNavTreeNode
protected DesignerProjectContext projectCtx()
AbstractResourceNavTreeNode
projectCtx
in class AbstractResourceNavTreeNode
public void onSelected()
AbstractNavTreeNode
onSelected
in class AbstractNavTreeNode
public void onDoubleClick()
AbstractNavTreeNode
onDoubleClick
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
public void closeAndCommit()
public void commitIfOpen()
public long getResourceId()
protected void addEditActions(javax.swing.JPopupMenu menu, java.util.List<AbstractNavTreeNode> selection)
AbstractNavTreeNode.addEditActions(JPopupMenu)
to support
adding menu items which may require the selection, such as the Copy Path
action.menu
- The JPopupMenu
to which edit
actions will be addedselection
- The selected nodes to which the menu appliesprotected void initPopupMenu(javax.swing.JPopupMenu menu, javax.swing.tree.TreePath[] paths, java.util.List<AbstractNavTreeNode> selection, int modifiers)
AbstractNavTreeNode
initPopupMenu
in class AbstractNavTreeNode