org.openswing.swing.mdi.java
Class ApplicationFunction

java.lang.Object
  extended byjavax.swing.tree.DefaultMutableTreeNode
      extended byorg.openswing.swing.mdi.java.ApplicationFunction
All Implemented Interfaces:
java.lang.Cloneable, javax.swing.tree.MutableTreeNode, java.io.Serializable, javax.swing.tree.TreeNode

public class ApplicationFunction
extends javax.swing.tree.DefaultMutableTreeNode

Title: OpenSwing Framework

Description: the tree/menubar item (of the MDI Frame). The server side must return a DefaultTreeModel that MUST contains ApplicationFunction objects.

Copyright: Copyright (C) 2006 Mauro Carniel

This file is part of OpenSwing Framework. This library is free software; you can redistribute it and/or modify it under the terms of the (LGPL) Lesser General Public License as published by the Free Software Foundation; GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. The author may be contacted at: maurocarniel@tin.it

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode
EMPTY_ENUMERATION
 
Constructor Summary
ApplicationFunction()
          Root node.
ApplicationFunction(boolean isSeparator)
          Root node or separator.
ApplicationFunction(java.lang.String nodeName, java.lang.String iconName)
          Constructor: a folder
ApplicationFunction(java.lang.String nodeName, java.lang.String iconName, java.lang.String tooltipText)
          Constructor: a folder
ApplicationFunction(java.lang.String nodeName, java.lang.String functionId, java.lang.String iconName, java.lang.String methodName)
          Constructor: a node function
ApplicationFunction(java.lang.String nodeName, java.lang.String functionId, java.lang.String iconName, java.lang.String methodName, java.lang.String tooltipText)
          Constructor: a node function
 
Method Summary
 javax.swing.KeyStroke getAccelerator()
           
 java.lang.String getDescription()
           
 java.lang.String getFunctionId()
           
 java.lang.String getIconName()
           
 java.lang.String getMethodName()
           
 java.lang.Character getShortCut()
           
 java.lang.String getTooltipText()
           
 boolean isFolder()
           
 boolean isSeparator()
           
 void setAccelerator(javax.swing.KeyStroke accelerator)
          Set the accelerator to use in order to select this function in the menu bar.
 void setDescription(java.lang.String description)
          Set node description.
 void setShortCut(java.lang.Character shortCut)
          Set the shortcut to use in order to select this function in the menu bar; if not setted, the shortcut is automatically defined by MDIFrame.
 java.lang.String toString()
           
 
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApplicationFunction

public ApplicationFunction()
Root node.


ApplicationFunction

public ApplicationFunction(boolean isSeparator)
Root node or separator.

Parameters:
isSeparator - true to set a separator, false to define a root node

ApplicationFunction

public ApplicationFunction(java.lang.String nodeName,
                           java.lang.String iconName)
Constructor: a folder

Parameters:
nodeName - description (already translated) to view in the tree node/menu item
iconName - image name

ApplicationFunction

public ApplicationFunction(java.lang.String nodeName,
                           java.lang.String iconName,
                           java.lang.String tooltipText)
Constructor: a folder

Parameters:
nodeName - description (already translated) to view in the tree node/menu item
iconName - image name
tooltipText - tooltip text (already translated) to view in the tree node/menu item

ApplicationFunction

public ApplicationFunction(java.lang.String nodeName,
                           java.lang.String functionId,
                           java.lang.String iconName,
                           java.lang.String methodName)
Constructor: a node function

Parameters:
nodeName - description (already translated) to view in the tree node/menu item
functionId - function identifier
iconName - image name
methodName - method name in ClientFacade to execute

ApplicationFunction

public ApplicationFunction(java.lang.String nodeName,
                           java.lang.String functionId,
                           java.lang.String iconName,
                           java.lang.String methodName,
                           java.lang.String tooltipText)
Constructor: a node function

Parameters:
nodeName - description (already translated) to view in the tree node/menu item
functionId - function identifier
iconName - image name
methodName - method name in ClientFacade to execute
Method Detail

getFunctionId

public final java.lang.String getFunctionId()
Returns:
function identifier

getIconName

public final java.lang.String getIconName()
Returns:
image icon

getMethodName

public final java.lang.String getMethodName()
Returns:
method name in ClientFacade to execute

isFolder

public final boolean isFolder()
Returns:
this node is a folder

getDescription

public final java.lang.String getDescription()
Returns:
node description

setDescription

public final void setDescription(java.lang.String description)
Set node description.


toString

public java.lang.String toString()

isSeparator

public final boolean isSeparator()
Returns:
this node is a separator

getTooltipText

public final java.lang.String getTooltipText()
Returns:
tooltip text associated to folder or function

getShortCut

public java.lang.Character getShortCut()
Returns:
shortcut to use in order to select this function in the menu bar; if not setted, the shortcut is automatically defined by MDIFrame

setShortCut

public final void setShortCut(java.lang.Character shortCut)
Set the shortcut to use in order to select this function in the menu bar; if not setted, the shortcut is automatically defined by MDIFrame.

Parameters:
shortCut - shortcut to use in order to select this function in the menu bar

getAccelerator

public final javax.swing.KeyStroke getAccelerator()
Returns:
accelerator to use in order to select this function in the menu bar

setAccelerator

public final void setAccelerator(javax.swing.KeyStroke accelerator)
Set the accelerator to use in order to select this function in the menu bar. Example for CTRL+X: KeyStroke.getKeyStroke('X',Event.CTRL_MASK)

Parameters:
accelerator - accelerator to use in order to select this function in the menu bar