|
Bean Builder | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.adventnet.components.menuframework.MenuFramework
This is the Base Class of the Menu Framework which provides the highly customizable XML based MenuFramework service. This class
provides API to create,insert,remove and replace the MenuBar, Menus & MenuItems. The MenuFramework takes an XML Document
as input and constructs the MenuBar based on the attributes present in the XML File. The menuframe work defined the
format in which the XML File has to be fed to the Framework.
|
This diagram depicts the extendable modules present in the MenuFramework.
try{
For the Popup related operation the user can use the getPopupMenuFramework()
API to get the Popup menu framework handle.
MenuFramework supports creation of JMenuBar from an xml file. User has to pass the xml Document ( org.w3c.dom.Document;)
as the input to the MenuFramework. The format of the xml file is defined in the MenuFramework.dtd file.
The MenuFramework also provide an utility to read the xml file from the specified URL or file.
|
![]() |
org.w3c.dom.Document xmlDocument = MenuFrameworkUtils.getDocument("../resources/MyMenuBar.xml")
or
org.w3c.dom.Document xmlDocument = MenuFrameworkUtils.getDocument(new java.net.URL("http://localhost/resources/MyMenuBar.xml"))
JMenuBar menuBar = mfw.createMenuBar(xmlDocument);
All the MenuBar created are cached by the framework. removeMenuBarFromCache("<menu bar namei>") API can
be used to remove the MenuBar from the Framework cache.
After creating the MenuBar user can use the other API's provided by the MenuFramework to insert,remove or replace the MenuItems and Menus. The MenuItems and Menus in a particular MenuBar can be addressed by giving menupath. The path that contains the menubar and the series of menus through which user have to move to reach the particular menu item is called the menupath.For Example, the menu-item
"File ----> Open -----> Project" present in the MenuBar named MyMenuBar can be addressed as
"MyMenuBar"+ mfw.getMenuPathSeparator() +"File" +mfw.getMenuPathSeparator() +"Open" +mfw.getMenuPathSeparator() +"Project".
By default the menupath separator is "#" (which can be configured using setMenuPathSeparator() API) so the,
above menupath can be redifined as "MyMenuBar#File#Open#Project".
Menupath helps the MenuFramework to uniquely identify the Menu/MenuItem present in a MenuBar.
The user can delete this Project menu-item by simply invoking
mfw.removeXMLMenuItem("MyMenuBar#File#Open#Project")
Action Handler Module
setReuseListeners , the same instance of EventListeners is shared across.
The framework doesn't instantiate a new EventListeners every time, when it creates the menu-item, instead the same instance of
EventListener is added as the Listener to the newly created menu-items. Whereas, in other case a new EventListener is created
for each and every menu-item and they were notified when an event occurs. The reuseListeners will come handy when your application
want to handle all the events occurring over all/set of menu-item at one place. This also gives a provision to share all the
EventListener created in MenuFramework by the ToolBarFramework and vice versa. i.e. the EventListener created in
MenuFramework can be reused to listen for an action occurring over a toolbar-item. All the cached EventListener's can be got
using the API getListenerList
Renderer Module
MenuItemInterface
Parser Module
setMenuParser
File Reader Module
setFileReaderClassName or setFileReader API's. For
further details refer to the FileReaderInterface.
XMLMenuItem,
XMLMenu,
PopupMenuFramework| Field Summary | |
protected static MenuFramework |
menuFramework
|
protected boolean |
menuOpertaionBegin
|
protected static java.lang.Character |
menuPathSeparator
|
protected boolean |
propagateToParent
|
| Constructor Summary | |
protected |
MenuFramework()
Instantiate Menu Frame Work with the no argument. |
| Method Summary | |
void |
addSeparator(java.lang.String menuPath)
Adds the Separator at the end of the specified JMenu. |
protected java.lang.Boolean |
addToMenuElementGroup(java.lang.String groupName,
java.lang.Object menuElementObject)
This API is used to add a menu or menu-item into the specified Menu Group. |
javax.swing.JMenu |
createMenu(org.w3c.dom.Document menuRootNode)
Parse the given Document using the DefaultMenuParser and Returns the JMenu. |
javax.swing.JMenu |
createMenu(org.w3c.dom.Document menuRootNode,
MenuParserInterface parser)
Parse the given Document using the specified parser and Returns the JMenu. |
javax.swing.JMenu |
createMenu(org.w3c.dom.Document menuRootNode,
java.lang.String parserClassName)
Parse the given Document using the specified parser and Returns the JMenu. |
javax.swing.JMenuBar |
createMenuBar(org.w3c.dom.Document menuRootNode)
Create a menu bar with the data available in the specified Document. |
javax.swing.JMenuBar |
createMenuBar(org.w3c.dom.Document menuRootNode,
MenuParserInterface parser)
Create a menu bar with the data available in the specified Document. |
javax.swing.JMenuBar |
createMenuBar(org.w3c.dom.Document menuRootNode,
MenuParserInterface parser,
java.lang.String menuBarNameToCache)
Create a menu bar with the data available in the specified Document. |
javax.swing.JMenuBar |
createMenuBar(org.w3c.dom.Document menuRootNode,
java.lang.String parserClassName)
Create a menu bar with the data available in the specified Document. |
protected MenuParserInterface |
createMenuParser(java.lang.String className)
This API is used to create the instance of MenuParserInterface. |
boolean |
doesTheMenuBarExist(java.lang.String menuBarName)
Returns true if the menubar with the specified name is cached by the framework, else it returns false. |
ActionHandlerInterface |
getActionHandler()
Returns the default action handler class. |
java.lang.String |
getActionHandlerClassName()
Returns the default action handler class name. |
java.util.Enumeration |
getAllMenuBarNames()
Returns the name of all cached menubars. |
java.lang.String |
getDefaultMenuParserClassName()
Returns the class name of the Default Menu-Parser. |
FileReaderInterface |
getFileReader()
Returns the fileReader instance which is presently used for reading the xml files and image files. |
java.lang.String |
getFileReaderClassName()
Returns the currently used file reader class name which is used to read xml and image files. |
static MenuFramework |
getInstance()
This API provides the MenuFramework handle using which the user can create MenuBar and manipulate the menus and/or menuitems. |
javax.swing.JMenuItem |
getJMenuItem(java.lang.String menuItemPath)
Returns the JMenuItem if it exist at the specified menu path otherwise it returns null. |
java.util.Hashtable |
getListenerList()
Returns the set of cached EventListeners. |
javax.swing.JMenuBar |
getMenuBar(java.lang.String menuBarName)
Returns the menubar of the name specified. |
MenuParserInterface |
getMenuParser()
Returns the MenuParser class instance which is presently used for parsing the xml documents to construct menu elements. |
java.lang.String |
getMenuParserClassName()
Returns the MenuParser class name which is presently used for parsing the xml documents to construct menu elements. |
char |
getMenuPathSeparator()
Returns the MenuPathSeparator. |
static PopupMenuFramework |
getPopupMenuFramework()
This API provides the Popup MenuFramework handle using which the user can create Popup menus. |
java.util.EventListener |
getSingletonListenerInstance(java.lang.String listenerClassName)
Returns an instance of EventListener for the specified classname. |
static java.lang.String |
getString(java.lang.String key)
|
XMLMenu |
getXMLMenu(java.lang.String menuPathName)
Returns XMLMenu from the Framework Cache. |
XMLMenuItem |
getXMLMenuItem(java.lang.String menuItemPath)
Returns the XMLMenuItem which contains the JMenuItem, if it exist at the specified menu path otherwise it returns null. |
protected java.util.Hashtable |
getXMLMenuItemList()
Returns all the menu and menu-items from all the cached Menu-bar. |
java.util.Vector |
getXMLMenus(java.lang.String menuBarName)
Returns vector of top level JMenus (i.e the menus which are directly added in the menubar) present in the menubar. |
protected static void |
initializeFramework()
|
void |
insertSeparatorAt(java.lang.String menuPath,
int position)
Inserts the Separator in the specified XMLMenu at the specified position. |
boolean |
insertXMLMenu(org.w3c.dom.Document rootNode,
java.lang.String previousMenuPath)
Inserts the XMLMenu at the specified path after constructing the XMLMenu from the input document. |
boolean |
insertXMLMenu(XMLMenu menu,
java.lang.String previousMenuPath)
Inserts the XMLMenu at the specified path. |
boolean |
insertXMLMenuAt(org.w3c.dom.Document rootNode,
java.lang.String parentMenuPath,
int position)
Inserts the XMLMenu at the specified position after constructing the XMLMenu from the input document. |
boolean |
insertXMLMenuAt(XMLMenu menu,
java.lang.String parentMenuPath,
int position)
Inserts the XMLMenu at the specified position. |
boolean |
insertXMLMenuItem(java.util.Hashtable menuItemAttributes,
java.lang.String previousMenuItemPath)
Construct a new XMLMenuItem from the given Hashtable and then Inserts the given XMLMenuItem after the specified menuitem. |
boolean |
insertXMLMenuItem(XMLMenuItem menuItem,
java.lang.String previousMenuItemPath)
Inserts the given XMLMenuItem after the specified menuitem. |
boolean |
insertXMLMenuItemAt(java.util.Hashtable menuItemAttributes,
java.lang.String parentMenuPath,
int position)
Construct a new XMLMenuItem from the given Hashtable and then Inserts this menuitem in the given position of the parent jmenu. |
boolean |
insertXMLMenuItemAt(XMLMenuItem menuItem,
java.lang.String parentMenuPath,
int position)
Inserts the given menuitem in the given position of the parent jmenu. |
boolean |
isActionPropagationAllowed()
This returns true when the action handling is allowed to propagate to the topmost level(menbar level) until it is consumed by one of the ActionHandlers i.e when the handleAction() of the ActionHandlerInterface returns true. |
protected boolean |
putXMLMenuItem(java.lang.String menuItemPath,
XMLMenuItem menuItem)
API which updates the cache maintained by the Framework. |
boolean |
removeMenuBarFromCache(java.lang.String menuBarName)
Clears the menuBar and all its traces from the menuframework cache. |
void |
removeMenuElementAt(java.lang.String parentMenuPath,
int position)
Removes the MenuElement( XMLMenu or XMLMenuItem or Separators) located at the specified position in the parentMenu. |
void |
removeSeparatorAt(java.lang.String menuPath,
int position)
Removes the Separator from the specified XMLMenu located at the specified position. |
XMLMenu |
removeXMLMenu(java.lang.String menuPath)
Removes the XMLMenu frame the MenuBar. |
XMLMenu |
removeXMLMenuAt(java.lang.String parentMenuPath,
int position)
Removes the XMLMenu located at the specified position in the parentMenu. |
XMLMenu |
removeXMLMenuAt(XMLMenu parentMenu,
int position)
Removes the XMLMenu located at the specified position in the parentMenu. |
void |
removeXMLMenuItem(java.lang.String menuItemPath)
Removes the specified XMLMenuItem from the menubar |
void |
removeXMLMenuItemAt(java.lang.String parentMenuPath,
int position)
Removes the MenuItem located at the specified position in the parent Menu. |
boolean |
replaceXMLMenu(org.w3c.dom.Document rootNode,
java.lang.String menuPath)
Replaces the XMLMenu at the specified path after creating new XMLMenu out of the specified document. |
boolean |
replaceXMLMenu(XMLMenu menu,
java.lang.String menuPath)
Replaces the XMLMenu at the specified path. |
boolean |
replaceXMLMenuAt(org.w3c.dom.Document rootNode,
java.lang.String parentMenuPath,
int position)
Replaces the XMLMenu at the specified position after creating new XMLMenu out of the specified document. |
boolean |
replaceXMLMenuAt(XMLMenu menu,
java.lang.String parentMenuPath,
int position)
Replaces the XMLMenu at the specified position. |
void |
replaceXMLMenuItem(java.util.Hashtable menuItemAttributes,
java.lang.String menuItemPath)
Replaces the MenuItem located at the specified menupath with the menuItem after creating it with specified attributes set. |
void |
replaceXMLMenuItem(java.util.Hashtable menuItemAttributes,
XMLMenuItem oldMenuItem)
Replaces the old menuItem with specified new menuitem created with the specified attributes. |
void |
replaceXMLMenuItem(XMLMenuItem item,
java.lang.String menuItemPath)
Replaces the MenuItem located at the specified menupath with the given menuItem. |
void |
replaceXMLMenuItem(XMLMenuItem newMenuItem,
XMLMenuItem oldMenuItem)
Replaces the old menuItem with specified new menuitem. |
void |
replaceXMLMenuItemAt(java.util.Hashtable menuItemAttributes,
java.lang.String parentMenuPath,
int position)
Replaces the MenuItem located at the specified position in the parent Menu with the menuItem created using the given Hashtable. |
void |
replaceXMLMenuItemAt(XMLMenuItem item,
java.lang.String parentMenuPath,
int position)
Replaces the MenuItem located at the specified position in the parent Menu with the given menuItem. |
void |
setActionHandler(ActionHandlerInterface actionhandlerinterface)
Sets the specified Action Handler class as the Default Action Handler. |
void |
setActionHandlerClassName(java.lang.String s)
Instantiate the ActionHandler for the specified class name and then sets this Action Handler class as the Default Action Handler. |
void |
setActionPropagation(boolean propagateToParent)
Sets the propagation allowed property on or off. |
void |
setFileReader(FileReaderInterface filereaderinterface)
Sets the fileReader instance which should be used for reading the xml and image files. |
void |
setFileReaderClassName(java.lang.String s)
Instantiate the FileReader for the specified class name and then sets this File Reader class as the Default File Reader. |
boolean |
setMenuEnabled(java.lang.String menuItemPath,
boolean enable)
Enabels or Disables a particular Menu or MenuItem. |
boolean |
setMenuGroupEnabled(java.lang.String menuGroupName,
boolean enable)
Enables or Disables the group of menus. |
void |
setMenuParser(MenuParserInterface menuparserinterface)
Sets the specified class as the Default Menu Parser. |
void |
setMenuParserClassName(java.lang.String s)
Instantiate the MenuParser for the specified class name and then sets this Menu Parser class as the Default Menu Parser. |
void |
setMenuPathSeparator(char ch)
Sets the given character as the menupath separator. |
void |
setResourceBundle(java.util.ResourceBundle pRBundle)
|
void |
setReuseListeners(boolean reuseOfListeners)
Sets the reuseListeners, which determines whether to create a new Instance of an EventListener including its subclass of EventListener or resuse the cached instance of EventListener. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected static MenuFramework menuFramework
protected boolean propagateToParent
protected static java.lang.Character menuPathSeparator
protected boolean menuOpertaionBegin
| Constructor Detail |
protected MenuFramework()
| Method Detail |
protected static void initializeFramework()
throws MenuException
public static MenuFramework getInstance()
throws MenuFrameworkUnintializedException
public static PopupMenuFramework getPopupMenuFramework()
throws MenuFrameworkUnintializedException
protected java.lang.Boolean addToMenuElementGroup(java.lang.String groupName,
java.lang.Object menuElementObject)
groupName - a String value of the groupName in which this menu/menu-item to be added.menuElementObject - an menu or menu-item object which should be grouped.Boolean valuesetMenuGroupEnabled()
public javax.swing.JMenuBar createMenuBar(org.w3c.dom.Document menuRootNode)
throws MenuException
menuRootNode - is a Document object.JMenuBar.
public javax.swing.JMenuBar createMenuBar(org.w3c.dom.Document menuRootNode,
java.lang.String parserClassName)
throws MenuException
menuRootNode - is a Document object.parserClassName - class name of the MenuParser which should be used for parsing the given documentJMenuBar.
public javax.swing.JMenuBar createMenuBar(org.w3c.dom.Document menuRootNode,
MenuParserInterface parser)
throws MenuException
menuRootNode - is a Document object.parser - instance of the MenuParser which should be used for parsing the given documentJMenuBar.
public javax.swing.JMenuBar createMenuBar(org.w3c.dom.Document menuRootNode,
MenuParserInterface parser,
java.lang.String menuBarNameToCache)
throws MenuException
menuRootNode - is a Document object.parser - instance of the MenuParser which should be used for parsing the given documentmenuBarNameToCache - name in which the the created menubar to be cached.JMenuBar.public java.util.Enumeration getAllMenuBarNames()
Enumeration value of all the cached menu-bar name.public javax.swing.JMenuBar getMenuBar(java.lang.String menuBarName)
menuBarName - a String value representing the menu-bar name which is passes as an
argument while creating the Menu-Bar or the "name attribute" present in the Menu-File.JMenuBar instance corresponding to the specified menubar-name.public java.util.Vector getXMLMenus(java.lang.String menuBarName)
menuBarName - a String valueVector value
public javax.swing.JMenu createMenu(org.w3c.dom.Document menuRootNode)
throws MenuException
menuRootNode - a Document node which represent the Menu File.JMenu value
public javax.swing.JMenu createMenu(org.w3c.dom.Document menuRootNode,
java.lang.String parserClassName)
throws MenuException
menuRootNode - a Document node which represent the Menu File.parserClassName - a String valueJMenu value
public javax.swing.JMenu createMenu(org.w3c.dom.Document menuRootNode,
MenuParserInterface parser)
throws MenuException
menuRootNode - a Document node which represent the Menu File.parser - a MenuParserInterface which should be used to parse this
particular Menu-File.JMenu which is constructed from the specifiedpublic XMLMenu getXMLMenu(java.lang.String menuPathName)
menuPathName - a String that represents the menubar and the series of menus
through which user have to move to reach the particular menu item/ menu.XMLMenu value
public boolean insertXMLMenuItemAt(XMLMenuItem menuItem,
java.lang.String parentMenuPath,
int position)
throws MenuException
menuItem - a XMLMenuItem instance which has to be inserted at the given location.parentMenuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the parent menu.position - an int value at which the user has to insert this particular menu-item.true if the menu-item successfully added
public boolean insertXMLMenuItemAt(java.util.Hashtable menuItemAttributes,
java.lang.String parentMenuPath,
int position)
throws MenuException
menuItemAttributes - a Hashtable value representing the attributes based on which
XMLMenuItem has to be created.parentMenuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the parent menu.position - an int value at which the user has to insert this particular menu-item.boolean value
public boolean insertXMLMenuItem(XMLMenuItem menuItem,
java.lang.String previousMenuItemPath)
throws MenuException
menuItem - a XMLMenuItem valuepreviousMenuItemPath - a String value that represents the menubar and the series of
menus through which user have to move to reach the previous menu.true when the menu-item is successfully inserted.
public boolean insertXMLMenuItem(java.util.Hashtable menuItemAttributes,
java.lang.String previousMenuItemPath)
throws MenuException
menuItemAttributes - a Hashtable value representing the attributes based on which
XMLMenuItem has to be created.previousMenuItemPath - a String value that represents the menubar and the series of
menus through which user have to move to reach the previous menu.true when the menu-item is successfully inserted.
public void replaceXMLMenuItemAt(XMLMenuItem item,
java.lang.String parentMenuPath,
int position)
throws MenuException
item - a XMLMenuItem which has to be replaced.parentMenuPath - a String value that represents the menubar and the series of
menus through which user have to move to reach the parent menu.position - an int value at which the menu-item has to replaced, present in the parent menu.
public void replaceXMLMenuItemAt(java.util.Hashtable menuItemAttributes,
java.lang.String parentMenuPath,
int position)
throws MenuException
menuItemAttributes - a Hashtable value representing the attributes based on which
XMLMenuItem has to be created.parentMenuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the particular parent menu.position - an int value at which the menu-item has to replaced, present in the parent menu.
public void replaceXMLMenuItem(XMLMenuItem item,
java.lang.String menuItemPath)
throws MenuException
item - a XMLMenuItem instance which has to be replaced in place of given menuItemPath.menuItemPath - a String that represents the menubar and the series of menus
through which user have to move to reach the particular menu item/ menu.
public void replaceXMLMenuItem(java.util.Hashtable menuItemAttributes,
java.lang.String menuItemPath)
throws MenuException
menuItemAttributes - a Hashtable value representing the attributes based on which XMLMenuItem has to be created.
through which user have to move to reach the particular menu item/ menu.menuItemPath - a String that represents the menubar and the series of menus
through which user have to move to reach the particular menu item/ menu.
public void replaceXMLMenuItem(java.util.Hashtable menuItemAttributes,
XMLMenuItem oldMenuItem)
throws MenuException
menuItemAttributes - a Hashtable value representing the attributes based on which XMLMenuItem has to be created.oldMenuItem - a XMLMenuItem instance which has to be repalced with the new menu-item (constructed out of the menuItemAttributes) specified.
public void replaceXMLMenuItem(XMLMenuItem newMenuItem,
XMLMenuItem oldMenuItem)
throws MenuException
newMenuItem - a XMLMenuItem instance which should replace the old one existing in the menu-bar.oldMenuItem - a XMLMenuItem instance which has to be repalced with the new menu-item specified.
public void removeXMLMenuItemAt(java.lang.String parentMenuPath,
int position)
throws MenuException
parentMenuPath - a String that represents the menubar and the series of menus * through which user have to move to reach the particular parent menu.position - an int of the menu-item which has to removed.
public void removeMenuElementAt(java.lang.String parentMenuPath,
int position)
throws MenuException
parentMenuPath - a String that represents the menubar and the series of menus * through which user have to move to reach the particular parent menu.position - an int of the menu-item/menu which has to removed.
public XMLMenu removeXMLMenuAt(java.lang.String parentMenuPath,
int position)
throws MenuException
parentMenuPath - a String that represents the menubar and the series of menus * through which user have to move to reach the particular parent menu.position - an int of the menu-item/menu which has to removed.XMLMenu instance which is removed from the menubar.
public XMLMenu removeXMLMenuAt(XMLMenu parentMenu,
int position)
throws MenuException
parentMenu - a XMLMenu in whcih the XMLMenu to be replaced, exists.position - an int of the menu-item/menu which has to removed.XMLMenu instance which is removed from the menubar.
public XMLMenu removeXMLMenu(java.lang.String menuPath)
throws MenuException
menuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the particular menu item/ menu.XMLMenu instance which is removed from the menubar.public boolean doesTheMenuBarExist(java.lang.String menuBarName)
menuBarName - a String value representing the menu-bar name which is passes as an
argument while creating the Menu-Bar or the "name attribute" present in the Menu-File.true when the menu-bar of specified name exist in the cache.
public void removeXMLMenuItem(java.lang.String menuItemPath)
throws MenuException
menuItemPath - a String that represents the menubar and the series of menus
through which user have to move to reach this particular menu item.
public boolean insertXMLMenuAt(XMLMenu menu,
java.lang.String parentMenuPath,
int position)
throws MenuException
menu - a XMLMenu instance which has to be inserted.parentMenuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the particular parent menu.position - an int value at which the menu-item has to inserted.true when insert succeeds.
public boolean insertXMLMenuAt(org.w3c.dom.Document rootNode,
java.lang.String parentMenuPath,
int position)
throws MenuException
rootNode - a Document value which should be used to construct the XMLMenu.parentMenuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the particular parent menu.position - an int value at which the menu has to be inserted in the parent menu.true when the insertion succeeds.
public boolean insertXMLMenu(org.w3c.dom.Document rootNode,
java.lang.String previousMenuPath)
throws MenuException
rootNode - a Document value which should be used to construct the XMLMenu.previousMenuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the previous menu after which the specified menu is going to be inserted.true when the insertion succeeds.
public boolean insertXMLMenu(XMLMenu menu,
java.lang.String previousMenuPath)
throws MenuException
menu - a XMLMenu which has to be inserted.previousMenuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the particular menu.true if insertion succeeds.
public boolean replaceXMLMenuAt(XMLMenu menu,
java.lang.String parentMenuPath,
int position)
throws MenuException
menu - a XMLMenu which has to be replaced.parentMenuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the parent menu under which this menu-item has to be replaced.position - an int value at which the menu-item has to replaced, present in the parent menu.true when replace succeeds.
public boolean replaceXMLMenuAt(org.w3c.dom.Document rootNode,
java.lang.String parentMenuPath,
int position)
throws MenuException
rootNode - a Document value which should be used to construct the XMLMenu.parentMenuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the parent menu under which this menu-item has to be replaced.position - an int value at which the menu-item has to replaced, present in the parent menu.true when replace succeeds.
public boolean replaceXMLMenu(XMLMenu menu,
java.lang.String menuPath)
throws MenuException
menu - a XMLMenu instance which has to be used to replace the older menu .menuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the this menu which item has to be replaced.true when replace succeeds.
public boolean replaceXMLMenu(org.w3c.dom.Document rootNode,
java.lang.String menuPath)
throws MenuException
rootNode - a Document value which should be used to construct the XMLMenu.menuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the particular menu item/ menu.true when replace succeeds.public boolean isActionPropagationAllowed()
true if the Action propagation is allowed.public void setActionPropagation(boolean propagateToParent)
propagateToParent - a boolean value
public boolean setMenuGroupEnabled(java.lang.String menuGroupName,
boolean enable)
menuGroupName - a String name which represent the "group_name" specified in the menu-file which is used
to construct menu-bar.enable - a boolean to enable the group of menu and/or menu-item.true if this enabling operation succeeds.
public boolean setMenuEnabled(java.lang.String menuItemPath,
boolean enable)
menuItemPath - a String that represents the menubar and the series of menus * through which user have to move to reach the particular menu item/ menu.enable - a boolean to enable the menu or menu-item.true if this enabling operation succeeds.public char getMenuPathSeparator()
charrepresenting the MenuPathSeparatorpublic void addSeparator(java.lang.String menuPath)
menuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the particular menu, after which this separator should be added.
public void removeSeparatorAt(java.lang.String menuPath,
int position)
menuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the particular parent menu where this separator reside.position - an int value at which this separator resides.
public void insertSeparatorAt(java.lang.String menuPath,
int position)
menuPath - a String that represents the menubar and the series of menus
through which user have to move to reach the particular parent menu where this separator has to be inserted.position - an int value at which the separator has to nserted.
protected boolean putXMLMenuItem(java.lang.String menuItemPath,
XMLMenuItem menuItem)
menuItemPath - a String valuemenuItem - a XMLMenuItem valueboolean valuepublic XMLMenuItem getXMLMenuItem(java.lang.String menuItemPath)
menuItemPath - a String that represents the menubar and the series of menus * through which user have to move to reach the particular menu item/ menu.XMLMenuItem instance which resides at this specified location.public javax.swing.JMenuItem getJMenuItem(java.lang.String menuItemPath)
menuItemPath - a String that represents the menubar and the series of menus * through which user have to move to reach the particular menu item/ menu.JMenuItem instance which resides at the specified location.public java.lang.String getFileReaderClassName()
String representing the fully qualified class name of the FileReaderInterface
which is presently by the framework to read the resources(images).DefaultFileReader,
setFileReaderClassName(java.lang.String)
public void setFileReaderClassName(java.lang.String s)
throws MenuException
s - a String value representing the fully qualified class name which should be used to fetch
the resources such as images and XML Documents.DefaultFileReader,
getFileReaderClassName()public FileReaderInterface getFileReader()
DefaultFileReader,
setFileReader(com.adventnet.components.projectworkspace.FileReaderInterface)public void setFileReader(FileReaderInterface filereaderinterface)
filereaderinterface - a FileReaderInterface instance which can be used to fetch the resources need
to construct the menu-bar.DefaultFileReader,
getFileReader()
public void setMenuParserClassName(java.lang.String s)
throws MenuException
s - a String value representing fully qualified classname of the parser class which has to
be used for parsing the specified XML Document to construct the menubar.DefaultMenuParser,
getMenuParserClassName()public java.lang.String getMenuParserClassName()
String value representing fully qualified classname of the parser class which is presently
used for parsing the specified XML Document to construct the menubar.DefaultMenuParser,
setMenuParserClassName(java.lang.String)public void setMenuParser(MenuParserInterface menuparserinterface)
menuparserinterface - a MenuParserInterface value of the parser class which is presently
used for parsing the specified XML Document to construct the menubar.DefaultMenuParser,
getMenuParser()public MenuParserInterface getMenuParser()
MenuParserInterface value of the parser class which is presently
used for parsing the specified XML Document to construct the menubar.DefaultMenuParser,
setMenuParser(com.adventnet.components.menuframework.MenuParserInterface)public java.lang.String getActionHandlerClassName()
String value representing the Action handler class name which presently handles the default actions
which are not handled by the menu specific Action handlers and Action Listeners.DefaultActionHandler,
getActionHandlerClassName()
public void setActionHandlerClassName(java.lang.String s)
throws MenuException
s - a String value representing the Action handler class name which should be used to handle the default actions
which are not handled by the menu specific Action handlers and Action Listeners.DefaultActionHandler,
setActionHandlerClassName(java.lang.String)public ActionHandlerInterface getActionHandler()
ActionHandlerInterface value representing the Action handler class which presently handles the default actions
which are not handled by the menu specific Action handlers and Action Listeners.getActionHandler(),
DefaultActionHandlerpublic void setActionHandler(ActionHandlerInterface actionhandlerinterface)
actionhandlerinterface - a String value representing the Action handler class which should be used to handle the default actions
which are not handled by the menu specific Action handlers and Action Listeners.DefaultActionHandler,
setActionHandler(com.adventnet.components.projectworkspace.ActionHandlerInterface)
public void setMenuPathSeparator(char ch)
throws MenuException
ch - a char value that represents the MenuPath Separator.protected java.util.Hashtable getXMLMenuItemList()
Hashtable with the keys as menu-path and values as the XMLMenu and/or XMLMenuItempublic java.lang.String getDefaultMenuParserClassName()
String value "com.adventnet.components.menuframework.DefaultMenuParser"
protected MenuParserInterface createMenuParser(java.lang.String className)
throws MenuException
public boolean removeMenuBarFromCache(java.lang.String menuBarName)
menuBarName - a String value represnting the name of the menu-bar which is specified at the
time of menu-bar creation or in the XML File.true if the menu-bar exist in the cache and the framework is able to remove it successfully.public void setReuseListeners(boolean reuseOfListeners)
reuseOfListeners - if it set to "true" then multiple instance of same listener is not createdgetSingletonListenerInstance(java.lang.String),
getListenerList()public java.util.Hashtable getListenerList()
getSingletonListenerInstance(java.lang.String),
setReuseListeners(boolean)public java.util.EventListener getSingletonListenerInstance(java.lang.String listenerClassName)
listenerClassName - Class name of the EventListenersetReuseListeners(boolean)public void setResourceBundle(java.util.ResourceBundle pRBundle)
public static java.lang.String getString(java.lang.String key)
|
Bean Builder | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||