|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | 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.
Nested Class Summary |
Nested classes inherited from class org.openide.nodes.Node |
Node.Cookie, Node.Handle, Node.IndexedProperty, Node.Property, Node.PropertySet |
Field Summary |
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_LEAF, 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 with the given children set for the given data object. |
|
DataNode(DataObject obj,
Children ch,
Lookup lookup)
Create a data node for a given data object. |
Method Summary | |
boolean |
canCopy()
|
boolean |
canCut()
|
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()
Deprecated. Use getActions(boolean) or do nothing and let the
data loader specify actions. |
protected Sheet |
createSheet()
|
void |
destroy()
|
SystemAction[] |
getActions()
Deprecated. Use getActions(boolean) |
Action[] |
getActions(boolean context)
Get actions for this data object. |
Node.Cookie |
getCookie(Class cl)
Get a cookie. |
DataObject |
getDataObject()
Get the represented data object. |
String |
getDisplayName()
Get the display name for the node. |
Node.Handle |
getHandle()
Handle for location of given data object. |
HelpCtx |
getHelpCtx()
|
String |
getHtmlDisplayName()
Get a display name formatted using the limited HTML subset supported by HtmlRenderer . |
Image |
getIcon(int type)
Get the displayed icon for this node. |
Image |
getOpenedIcon(int type)
Get the displayed icon for this node. |
Action |
getPreferredAction()
Get default action. |
static boolean |
getShowFileExtensions()
Determine whether file extensions should be shown by default. |
void |
setName(String 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, getDefaultAction, getDropType, getNewTypes, getPasteTypes, getPropertySets, getSheet, hasCustomizer, setCookieSet, setDefaultAction, setIconBase, setIconBaseWithExtension, 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 |
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()
public DataNode(DataObject obj, Children ch, Lookup lookup)
obj
- object to work withch
- children container for the nodelookup
- the lookup to provide content of Node.getLookup()
and also getCookie(java.lang.Class)
getShowFileExtensions()
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)
public String getDisplayName()
specially alter
this.
Subclassers overriding this method should consider the recommendations
in DataObject.createNodeDelegate()
.
public String getHtmlDisplayName()
HtmlRenderer
. If the underlying
FileSystem.Status
is an instance of HmlStatus,
this method will return non-null if status information is added.
HtmlRenderer
,
Node.getHtmlDisplayName()
public Image getIcon(int type)
specially alter
this.
Subclassers overriding this method should consider the recommendations
in DataObject.createNodeDelegate()
.
type
- the icon type from BeanInfo
public Image getOpenedIcon(int type)
specially alter
this.
Subclassers overriding this method should consider the recommendations
in DataObject.createNodeDelegate()
.
type
- the icon type from BeanInfo
public HelpCtx getHelpCtx()
public boolean canRename()
DataObject.isRenameAllowed()
public boolean canDestroy()
DataObject.isDeleteAllowed()
public void destroy() throws IOException
IOException
public boolean canCopy()
public boolean canCut()
protected SystemAction[] createActions()
getActions(boolean)
or do nothing and let the
data loader specify actions.
public Action[] getActions(boolean context)
null
DataLoader.getActions()
public SystemAction[] getActions()
null
public Action getPreferredAction()
null
is returned in case the underlying data
object is a template. The templates should not have any default
action.
null
then
the first action returned from getActions (false) 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.
Subclassers overriding this method should consider the recommendations
in DataObject.createNodeDelegate()
. Since version 5.6, if
non-null Lookup
is passed to the constructor, then this
method directly delegates to super.getCookie and does
not query data object at all. This is supposed to provide consistency
between results in getLookup().lookup
and getCookie
.
null
protected Sheet createSheet()
public Transferable clipboardCopy() throws IOException
ExTransferable.Single
with one copy flavor
IOException
- if it could not copyNodeTransfer
public Transferable clipboardCut() throws IOException
ExTransferable.Single
with one cut flavor
IOException
- if it could not cutNodeTransfer
public Node.Handle getHandle()
public static boolean getShowFileExtensions()
true
if sopublic static void setShowFileExtensions(boolean s)
s
- true
if so
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |