org.tentackle.appworx
Interface AppDbObjectTreeExtension


public interface AppDbObjectTreeExtension

Interface to add features to objects displayed in an AppDbObjectTree.

Objects must implement this interface if:

Author:
harald

Method Summary
 boolean allowsTreeChildObjects()
          Determines whether this object may have child objects that should be visible in a navigatable tree.
 boolean dropTransferable(Transferable transferable)
          Drops a transferable on this object.
 AppDbObjectTreeExtensionEditor getEditor()
          Defines an editor that will be invoked to edit this tree object.
The editor should be a modal dialog, i.e.
 JMenuItem[] getExtraMenuItems(AppDbObjectTree tree, DefaultMutableTreeNode node)
          Defines additional menu items in the popup menu.
 ImageIcon getIcon()
          Gets the icon of this object.
 Runnable getOpenEditor()
          Defines an editor that will be invoked to "open" this tree object.
"open" usually means to open a dialog.
 AppDbObjectTreeExtensionToggleNode[] getToggleNodes(AppDbObjectTree tree, DefaultMutableTreeNode node)
          Defines additional toggle nodes.
 String getToolTipText()
          Gets the tooltip to be displayed for an object in a tree.
 Transferable getTransferable()
          Gets the Transferable for this object.
Used for drag and drop.
 List<Object> getTreeChildObjects()
          Gets all childs of this objects that should be visible to the user in a navigatable object tree.
 List<Object> getTreeChildObjects(Object parentObject)
          Gets the childs with respect to the parent object this object is displayed in the current tree.
 boolean isRemovable()
          Returns whether this object can be removed.
 

Method Detail

getOpenEditor

Runnable getOpenEditor()
Defines an editor that will be invoked to "open" this tree object.
"open" usually means to open a dialog. A special menu-item will be created in the popup-menu for those objects. (ex. to work on a PDF-Document) The object itself will not be reloaded before the runnable is executed.

Returns:
a editor if objects needs a special way to "open" it, null = none.

getEditor

AppDbObjectTreeExtensionEditor getEditor()
Defines an editor that will be invoked to edit this tree object.
The editor should be a modal dialog, i.e. not return until editing is done.

Returns:
the editor, null = no special editor, i.e. use default editor

getExtraMenuItems

JMenuItem[] getExtraMenuItems(AppDbObjectTree tree,
                              DefaultMutableTreeNode node)
Defines additional menu items in the popup menu.

Parameters:
tree - the tree
node - the node the popup menu refers to
Returns:
an array of additional JMenuItems to be appended to the popup-menu, null = none

getToggleNodes

AppDbObjectTreeExtensionToggleNode[] getToggleNodes(AppDbObjectTree tree,
                                                    DefaultMutableTreeNode node)
Defines additional toggle nodes.

Parameters:
tree - the tree
node - the node the popup menu refers to
Returns:
an array of additional AppDbObjectTreeExtensionToggleNode to be prepended to the popup-menu, null = none

getTransferable

Transferable getTransferable()
Gets the Transferable for this object.
Used for drag and drop.

Returns:
the transferable, null if none

dropTransferable

boolean dropTransferable(Transferable transferable)
Drops a transferable on this object.

Parameters:
transferable - the Transferable
Returns:
true if drop succeeded, else false

isRemovable

boolean isRemovable()
Returns whether this object can be removed.

Returns:
true if removable

allowsTreeChildObjects

boolean allowsTreeChildObjects()
Determines whether this object may have child objects that should be visible in a navigatable tree.

Returns:
true if object may have childs

getTreeChildObjects

List<Object> getTreeChildObjects()
Gets all childs of this objects that should be visible to the user in a navigatable object tree.

Returns:
the childs, null = no childs

getTreeChildObjects

List<Object> getTreeChildObjects(Object parentObject)
Gets the childs with respect to the parent object this object is displayed in the current tree.

Parameters:
parentObject - the parent object of this object in the tree, null = no parent
Returns:
the list of childs

getIcon

ImageIcon getIcon()
Gets the icon of this object.

Returns:
the icon, null if none

getToolTipText

String getToolTipText()
Gets the tooltip to be displayed for an object in a tree.

Returns:
the tooltip text, null if none


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de