com.wewebu.ow.server.ui
Class OwMenu

java.lang.Object
  extended by com.wewebu.ow.server.ui.OwEventTarget
      extended by com.wewebu.ow.server.ui.OwView
          extended by com.wewebu.ow.server.ui.OwNavigationView
              extended by com.wewebu.ow.server.ui.OwMenu
All Implemented Interfaces:
OwBaseView, OwUpdateTarget
Direct Known Subclasses:
OwMenuView

public abstract class OwMenu
extends OwNavigationView

Base class for menus for the Workdesk.
The Menu Items can consist of Icons or Text or both.

Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.

For licensing information read the license.txt file or
go to: http://wiki.alfresco.com


Nested Class Summary
 class OwMenu.OwMenuTab
          a navigation item
 
Nested classes/interfaces inherited from class com.wewebu.ow.server.ui.OwNavigationView
OwNavigationView.OwDelimiterTabInfo, OwNavigationView.OwTabInfo
 
Field Summary
protected  int defaultButtonIndex
          the default button index
protected static int NO_DEFAULT_BUTTON
          constant for situation when no default button was considered for this menu
 
Fields inherited from class com.wewebu.ow.server.ui.OwNavigationView
m_fValidatePanels, m_iCurrentTabIndex, m_TabList
 
Fields inherited from class com.wewebu.ow.server.ui.OwView
CURRENT_MODULE_KEY, FORMULAR_PLACEHOLDER_END_DELIMITER, FORMULAR_PLACEHOLDER_START_DELIMITER, m_externalFormEventTarget
 
Fields inherited from interface com.wewebu.ow.server.ui.OwBaseView
EMPTY_STRING
 
Constructor Summary
OwMenu()
           
 
Method Summary
 int addFormMenuItem(OwEventTarget target_p, String strTitle_p, String strEvent_p, String strToolTip_p)
          add a menu Item to the navigation module.
 int addFormMenuItem(OwEventTarget target_p, String strTitle_p, String strImage_p, String strEvent_p, Object oReason_p, String strToolTip_p)
          add a menu Item to the navigation module.
 int addFormMenuItem(OwEventTarget target_p, String strTitle_p, String strImage_p, String strEvent_p, Object oReason_p, String strToolTip_p, String strFormName_p)
          add a menu Item to the navigation module.
 int addFormMenuItem(OwEventTarget target_p, String strTitle_p, String strEvent_p, String strToolTip_p, String strFormName_p)
          add a menu Item to the navigation module.
 int addMenuItem(OwEventTarget target_p, String strTitle_p, String strEvent_p, String strToolTip_p)
          add a menu Item to the navigation module.
 int addMenuItem(OwEventTarget target_p, String strTitle_p, String strImage_p, String strEvent_p, Object oReason_p, String strToolTip_p)
          add a menu Item to the navigation module.
 void check(boolean fEnable_p, int iIndex_p)
          display a checkbox
protected  OwMenu.OwMenuTab createTabInfo(OwEventTarget target_p, String strTitle_p, String strImage_p, Object oReason_p, String strEvent_p, String strToolTip_p)
          overridable to create a tab info
protected  Object getImage(int iIndex_p)
          get the user object of the menu item
 String getMenuEventURL()
          Method to be called from renderer, which is called if there is a default button defined.
 boolean isChecked(int iIndex_p)
          determine if the button is checked via check function
protected  void onRender(Writer w_p)
          Add code for register menu event to ENTER keyboard event.
 void setDefaultMenuItem(int defaultMenuItemIndex_p)
          Specify what index from existing entries should be considered as default for ENTER key at a specific moment.
protected  void setFormSubmitButton(String strFormName_p, int iButtonIndex_p)
          specify a button in the navigation view to act as a form submit button
 void setImage(String strImage_p, int iIndex_p)
          change the user object of the menu item
 void toggleCheck(int iIndex_p)
          toggle the checked state
 
Methods inherited from class com.wewebu.ow.server.ui.OwNavigationView
addDelimiter, addMenuItem, addView, clear, enable, enableAll, getNavigateEventURL, getNavigationFormAction, getNavigationIndex, getTabList, getTitle, getViewReference, isLastTabIndex, isPreviousPanelValid, navigate, navigate, navigateFirst, onFormEvent, onNavigate, renderCurrentView, renderNavigationLink, setValidatePanels, size
 
Methods inherited from class com.wewebu.ow.server.ui.OwView
activate, addView, detach, getBreadcrumbPart, getDocument, getExternalFormEventTarget, getFormName, getFormTarget, getIcon, getIterator, getMaximizeView, getParent, getRenderedNamedRegion, getRenderedRegion, getViewList, init, isFormTargetExternal, isNamedRegion, isRegion, isShowMaximized, isShowMinimized, isShowNormal, onActivate, onUpdate, render, renderHTMLFormular, renderNamedRegion, renderRegion, serverSideDesignInclude, serverSideInclude, setDocument, setExternalFormTarget, setMaximizeView, setParent, showMaximized, showMinimized, showNormal, usesFormWithAttributes
 
Methods inherited from class com.wewebu.ow.server.ui.OwEventTarget
attach, disableRequestListener, enableRequestListener, getAjaxEventURL, getContext, getEventURL, getFormEventFunction, getFormEventURL, getID, onExternalRequest, onRequest, updateExternalFormTarget
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_DEFAULT_BUTTON

protected static final int NO_DEFAULT_BUTTON
constant for situation when no default button was considered for this menu

See Also:
Constant Field Values

defaultButtonIndex

protected int defaultButtonIndex
the default button index

Constructor Detail

OwMenu

public OwMenu()
Method Detail

isChecked

public boolean isChecked(int iIndex_p)
determine if the button is checked via check function


check

public void check(boolean fEnable_p,
                  int iIndex_p)
           throws Exception
display a checkbox

Parameters:
fEnable_p - true = check the box, false = uncheck
iIndex_p - button index
Throws:
Exception

toggleCheck

public void toggleCheck(int iIndex_p)
                 throws Exception
toggle the checked state

Throws:
Exception

setFormSubmitButton

protected void setFormSubmitButton(String strFormName_p,
                                   int iButtonIndex_p)
                            throws Exception
specify a button in the navigation view to act as a form submit button

Parameters:
strFormName_p - Name of the form where the button is used
iButtonIndex_p - Index of the menu button to act as submit button
Throws:
Exception

setImage

public void setImage(String strImage_p,
                     int iIndex_p)
change the user object of the menu item

Parameters:
strImage_p - image
iIndex_p - int index of the item to set the object for

getImage

protected Object getImage(int iIndex_p)
get the user object of the menu item

Parameters:
iIndex_p - int index of the item to set the object for

addMenuItem

public int addMenuItem(OwEventTarget target_p,
                       String strTitle_p,
                       String strEvent_p,
                       String strToolTip_p)
                throws Exception
add a menu Item to the navigation module.

Parameters:
target_p - View to be notified in case menu item was pressed.
strTitle_p - name of the tab to be displayed
strEvent_p - name of the event method to be called in the event target.
strToolTip_p - Tooltip text
Throws:
Exception

addMenuItem

public int addMenuItem(OwEventTarget target_p,
                       String strTitle_p,
                       String strImage_p,
                       String strEvent_p,
                       Object oReason_p,
                       String strToolTip_p)
                throws Exception
add a menu Item to the navigation module.

Parameters:
target_p - View to be notified in case menu item was pressed.
strTitle_p - name of the tab to be displayed
strImage_p - optional Image
strEvent_p - name of the event method to be called in the event target.
oReason_p - optional object to be submitted to the event handler. Can be null.
strToolTip_p - Tooltip text
Throws:
Exception

createTabInfo

protected OwMenu.OwMenuTab createTabInfo(OwEventTarget target_p,
                                         String strTitle_p,
                                         String strImage_p,
                                         Object oReason_p,
                                         String strEvent_p,
                                         String strToolTip_p)
overridable to create a tab info

Parameters:
target_p -
strTitle_p -
strImage_p -
oReason_p -
strEvent_p -
strToolTip_p -
Returns:
OwMenuTab

addFormMenuItem

public int addFormMenuItem(OwEventTarget target_p,
                           String strTitle_p,
                           String strEvent_p,
                           String strToolTip_p,
                           String strFormName_p)
                    throws Exception
add a menu Item to the navigation module.

Parameters:
target_p - View to be notified in case menu item was pressed.
strTitle_p - name of the tab to be displayed
strEvent_p - name of the event method to be called in the event target.
strToolTip_p - Tooltip text
strFormName_p - Form Name
Throws:
Exception

addFormMenuItem

public int addFormMenuItem(OwEventTarget target_p,
                           String strTitle_p,
                           String strEvent_p,
                           String strToolTip_p)
                    throws Exception
add a menu Item to the navigation module. Uses the form name of the target

Parameters:
target_p - View to be notified in case menu item was pressed.
strTitle_p - name of the tab to be displayed
strEvent_p - name of the event method to be called in the event target.
strToolTip_p - Tooltip text
Throws:
Exception

addFormMenuItem

public int addFormMenuItem(OwEventTarget target_p,
                           String strTitle_p,
                           String strImage_p,
                           String strEvent_p,
                           Object oReason_p,
                           String strToolTip_p,
                           String strFormName_p)
                    throws Exception
add a menu Item to the navigation module.

Parameters:
target_p - View to be notified in case menu item was pressed.
strTitle_p - name of the tab to be displayed
strImage_p - optional image
strEvent_p - name of the event method to be called in the event target.
oReason_p - optional object to be submitted to the event handler. Can be null.
strToolTip_p - Tooltip text
strFormName_p - Form Name
Throws:
Exception

addFormMenuItem

public int addFormMenuItem(OwEventTarget target_p,
                           String strTitle_p,
                           String strImage_p,
                           String strEvent_p,
                           Object oReason_p,
                           String strToolTip_p)
                    throws Exception
add a menu Item to the navigation module. Uses the form name of the target

Parameters:
target_p - View to be notified in case menu item was pressed.
strTitle_p - name of the tab to be displayed
strImage_p - optional image
strEvent_p - name of the event method to be called in the event target.
oReason_p - optional object to be submitted to the event handler. Can be null.
strToolTip_p - Tooltip text
Throws:
Exception

setDefaultMenuItem

public void setDefaultMenuItem(int defaultMenuItemIndex_p)
Specify what index from existing entries should be considered as default for ENTER key at a specific moment.

Parameters:
defaultMenuItemIndex_p - - the index
Since:
2.5.2.0

onRender

protected void onRender(Writer w_p)
                 throws Exception
Add code for register menu event to ENTER keyboard event. The event is registered only when the menu item is enabled.

Overrides:
onRender in class OwNavigationView
Parameters:
w_p - Writer object to write HTML to
Throws:
Exception
See Also:
OwNavigationView.onRender(java.io.Writer)

getMenuEventURL

public String getMenuEventURL()
Method to be called from renderer, which is called if there is a default button defined.

Returns:
String event URL
Since:
4.0.0.0


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.