org.rhq.enterprise.gui.navigation.contextmenu
Class TreeContextMenuBase

java.lang.Object
  extended by org.rhq.enterprise.gui.navigation.contextmenu.TreeContextMenuBase
Direct Known Subclasses:
AutoGroupTreeContextMenuUIBean, ResourceGroupTreeContextMenuUIBean, ResourceTreeContextMenuUIBean

public abstract class TreeContextMenuBase
extends Object

Author:
Lukas Krejci

Constructor Summary
TreeContextMenuBase()
           
 
Method Summary
protected  void addAdditionalMenuItems(org.richfaces.component.html.ContextMenu menu)
          Override this method if any additional menu items need to be created in the menu.
protected  void addMenuItem(String id, String value, boolean disabled)
           
protected abstract  List<MetricMenuItemDescriptor> getGraphToViewMenuItems()
          The menu items of this menu must provide the metric token.
 org.richfaces.component.html.ContextMenu getMenu()
           
protected abstract  List<String> getMenuHeaders()
           
protected abstract  QuickLinksDescriptor getMenuQuickLinks()
          The descriptor describes the URLs to use for the individual links.
protected abstract  List<MenuItemDescriptor> getOperationsMenuItems()
           
protected abstract  int getResourceTypeId()
           
protected abstract  List<MenuItemDescriptor> getViewChartsMenuItems()
           
protected abstract  void init()
          Subclasses can initialize themselves in this method before the other methods are called.
 void setMenu(org.richfaces.component.html.ContextMenu menu)
           
protected abstract  boolean shouldCreateMenu()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeContextMenuBase

public TreeContextMenuBase()
Method Detail

getMenu

public org.richfaces.component.html.ContextMenu getMenu()

setMenu

public void setMenu(org.richfaces.component.html.ContextMenu menu)
             throws Exception
Throws:
Exception

addMenuItem

protected void addMenuItem(String id,
                           String value,
                           boolean disabled)

init

protected abstract void init()
                      throws Exception
Subclasses can initialize themselves in this method before the other methods are called.

Throws:
Exception - the initialization might fail

shouldCreateMenu

protected abstract boolean shouldCreateMenu()
Returns:
true if the menu should be rendered, false otherwise

getMenuHeaders

protected abstract List<String> getMenuHeaders()
Returns:
List of strings to be used as the menu headers. For each such string a disabled menu item is created.

getResourceTypeId

protected abstract int getResourceTypeId()
Returns:
the resource type id of the current item in the nav tree.

getMenuQuickLinks

protected abstract QuickLinksDescriptor getMenuQuickLinks()
The descriptor describes the URLs to use for the individual links. If any of the properties in the descriptor is left null, no quick link is created for the corresponding item even if there are enough privileges for the user to access such tab.

Returns:
the descriptor for the quick links to be created

addAdditionalMenuItems

protected void addAdditionalMenuItems(org.richfaces.component.html.ContextMenu menu)
Override this method if any additional menu items need to be created in the menu. This method is called after the quick links are added to the provided menu.

Parameters:
menu - the context menu being created.

getViewChartsMenuItems

protected abstract List<MenuItemDescriptor> getViewChartsMenuItems()

getGraphToViewMenuItems

protected abstract List<MetricMenuItemDescriptor> getGraphToViewMenuItems()
The menu items of this menu must provide the metric token.

Returns:
the list of menu items for the "Graph To View" sub menu

getOperationsMenuItems

protected abstract List<MenuItemDescriptor> getOperationsMenuItems()


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.