|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.beans.FeatureDescriptor | +--org.openide.nodes.Node | +--org.openide.nodes.AbstractNode | +--org.openide.loaders.DataNode
Standard node representing a data object.
Inner classes inherited from class org.openide.nodes.Node |
Node.Cookie, Node.Handle, Node.IndexedProperty, Node.Property, Node.PropertySet |
Fields inherited from class org.openide.nodes.AbstractNode |
displayFormat, systemActions |
Fields inherited from class org.openide.nodes.Node |
EMPTY, PROP_COOKIE, PROP_DISPLAY_NAME, PROP_ICON, PROP_NAME, PROP_OPENED_ICON, PROP_PARENT_NODE, PROP_PROPERTY_SETS, PROP_SHORT_DESCRIPTION |
Constructor Summary | |
DataNode(DataObject obj,
Children ch)
Create a data node for a given data object. |
Method Summary | |
boolean |
canCopy()
Can this node be copied? |
boolean |
canCut()
Can this node be cut? |
boolean |
canDestroy()
Indicate whether the node may be destroyed. |
boolean |
canRename()
Indicate whether the node may be renamed. |
Transferable |
clipboardCopy()
Copy this node to the clipboard. |
Transferable |
clipboardCut()
Cut this node to the clipboard. |
protected SystemAction[] |
createActions()
This method returns null to signal that actions provide by DataLoader.getActions should be returned from method getActions. |
protected Sheet |
createSheet()
Initialize a default property sheet; commonly overridden. |
void |
destroy()
Remove the node from its parent and deletes it. |
SystemAction[] |
getActions()
Get actions for this data object. |
Node.Cookie |
getCookie(Class cl)
Get a cookie. |
DataObject |
getDataObject()
Get the represented data object. |
SystemAction |
getDefaultAction()
Get default action. |
String |
getDisplayName()
Get the display name for the node. |
Node.Handle |
getHandle()
Handle for location of given data object. |
HelpCtx |
getHelpCtx()
Get context help associated with this node. |
Image |
getIcon(int type)
Get the displayed icon for this node. |
Image |
getOpenedIcon(int type)
Get the displayed icon for this node. |
static boolean |
getShowFileExtensions()
Should file extensions be shown by default? By default, no. |
void |
setName(String name)
Set the system name. |
void |
setName(String name,
boolean rename)
Changes the name of the node and may also rename the data object. |
static void |
setShowFileExtensions(boolean s)
Set whether file extensions should be shown by default. |
Methods inherited from class org.openide.nodes.AbstractNode |
cloneNode, createPasteTypes, drag, getCookieSet, getCustomizer, getDropType, getNewTypes, getPasteTypes, getPropertySets, getSheet, hasCustomizer, setCookieSet, setDefaultAction, setIconBase, setSheet |
Methods inherited from class java.beans.FeatureDescriptor |
attributeNames, getName, getShortDescription, getValue, isExpert, isHidden, isPreferred, setExpert, setHidden, setPreferred, setValue |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DataNode(DataObject obj, Children ch)
obj
- object to work withch
- children container for the nodegetShowFileExtensions()
Method Detail |
public DataObject getDataObject()
public void setName(String name, boolean rename)
name
- new name for the objectrename
- rename the data object?IllegalArgumentException
- if the rename failedpublic void setName(String name)
AbstractNode
AbstractNode.displayFormat
.setName
in class AbstractNode
org.openide.nodes.AbstractNode
s
- the new namepublic String getDisplayName()
specially alter
this.getDisplayName
in class FeatureDescriptor
public Image getIcon(int type)
specially alter
this.getIcon
in class AbstractNode
type
- the icon type from BeanInfo
public Image getOpenedIcon(int type)
specially alter
this.getOpenedIcon
in class AbstractNode
type
- the icon type from BeanInfo
public HelpCtx getHelpCtx()
Node
getHelpCtx
in class AbstractNode
org.openide.nodes.Node
null
or HelpCtx.DEFAULT_HELP
)public boolean canRename()
canRename
in class AbstractNode
DataObject.isRenameAllowed()
public boolean canDestroy()
canDestroy
in class AbstractNode
DataObject.isDeleteAllowed()
public void destroy() throws IOException
Node
children's lock
, and removes
the node from its parent (if any). Also fires a property change.
This may be overridden by subclasses to do any additional cleanup.
destroy
in class Node
org.openide.nodes.Node
IOException
- if something failspublic boolean canCopy()
AbstractNode
canCopy
in class AbstractNode
org.openide.nodes.AbstractNode
true
public boolean canCut()
AbstractNode
canCut
in class AbstractNode
org.openide.nodes.AbstractNode
false
protected SystemAction[] createActions()
createActions
in class AbstractNode
public SystemAction[] getActions()
getActions
in class AbstractNode
null
DataLoader.getActions()
public SystemAction getDefaultAction()
default action
if it represents a template.getDefaultAction
in class AbstractNode
null
then
the first action returned from getActions () method is used.public Node.Cookie getCookie(Class cl)
DataObject.getCookie(java.lang.Class)
is
called. If it produces non-null
result, that is returned.
Otherwise the superclass is tried.getCookie
in class AbstractNode
null
protected Sheet createSheet()
AbstractNode
AbstractNode.getSheet()
is called and there is not yet a sheet,
this method is called to allow a subclass
to specify its properties.
Warning: Do not call getSheet
in this method.
The default implementation returns an empty sheet.
createSheet
in class AbstractNode
org.openide.nodes.AbstractNode
null
)public Transferable clipboardCopy() throws IOException
clipboardCopy
in class AbstractNode
ExTransferable.Single
with one copy flavorIOException
- if it could not copyNodeTransfer
public Transferable clipboardCut() throws IOException
clipboardCut
in class AbstractNode
ExTransferable.Single
with one cut flavorIOException
- if it could not cutNodeTransfer
public Node.Handle getHandle()
getHandle
in class AbstractNode
public static boolean getShowFileExtensions()
true
if sopublic static void setShowFileExtensions(boolean s)
s
- true
if so
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |