com.wewebu.ow.server.ui
Class OwNavigationView

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
All Implemented Interfaces:
OwBaseView, OwUpdateTarget
Direct Known Subclasses:
OwMainNavigationView, OwMenu, OwSubNavigationView

public abstract class OwNavigationView
extends OwView

Base Class for all Navigation Views / Menus / Multiple View Navigations.

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 OwNavigationView.OwDelimiterTabInfo
          info class for the tabulator view and name and optional data
static interface OwNavigationView.OwTabInfo
           Info class for the tabulator view and name and optional data to be overloaded by the implementing menu.
 
Field Summary
protected  boolean m_fValidatePanels
          flag indicating if panels should be validated
protected  int m_iCurrentTabIndex
          currently selected tab view index
protected  ArrayList m_TabList
          list of OwTabInfos
 
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
OwNavigationView()
           
 
Method Summary
 int addDelimiter()
          add a delimiter without function and without text
protected  int addMenuItem(OwNavigationView.OwTabInfo info_p)
          add a menu Item to the navigation module.
protected  int addView(OwNavigationView.OwTabInfo info_p, String strViewName_p)
          add a View to the navigation module.
 void clear()
          clears all the added views in which this navigation view is navigating.
 void enable(int iIndex_p, boolean fEnable_p)
          enable specified menu items
 void enableAll(boolean fEnable_p)
          enables all menu items
 String getNavigateEventURL(int iIndex_p)
          event URL to navigate through the tabs NOTE: If a form is used, the EventURL contains '' primes.
 String getNavigationFormAction(int iIndex_p)
          get the action string to be inserted into a form, which will then submit a request equal to the button index
 int getNavigationIndex()
          get the currently selected navigation index, form multiple views panel
 List getTabList()
          get the tab information for each navigation / menu element
 String getTitle()
          overridable title of the view
 OwBaseView getViewReference()
          get the reference to the active view
 boolean isLastTabIndex(int i_p)
          check if the given index is the last one
 boolean isPreviousPanelValid(int iIndex_p)
          check if previous panel is valid
 void navigate(int iIndex_p)
          navigate to the selected view index.
 void navigate(String strTargetID_p)
          navigate to the selected view with the given target ID.
 void navigateFirst()
          navigate to the first error free view
 void onFormEvent(javax.servlet.http.HttpServletRequest request_p)
          called before a form event is caught.
 void onNavigate(javax.servlet.http.HttpServletRequest request_p)
          event called when user clicked a tab
protected  void onRender(Writer w_p)
          render the navigation bar
 void renderCurrentView(Writer w_p)
          render the currently selected view
 void renderNavigationLink(Writer w_p, OwNavigationView.OwTabInfo tabInfo_p, int index_p, int last_p, int selected_p)
          render a single navigation tab
 void setValidatePanels(boolean fValidatePanels_p)
          flag indicating if panels should be validated
 int size()
          get the number of views to navigate
 
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

m_fValidatePanels

protected boolean m_fValidatePanels
flag indicating if panels should be validated


m_iCurrentTabIndex

protected int m_iCurrentTabIndex
currently selected tab view index


m_TabList

protected ArrayList m_TabList
list of OwTabInfos

Constructor Detail

OwNavigationView

public OwNavigationView()
Method Detail

addDelimiter

public int addDelimiter()
add a delimiter without function and without text


addMenuItem

protected int addMenuItem(OwNavigationView.OwTabInfo info_p)
                   throws Exception
add a menu Item to the navigation module.

Parameters:
info_p - item to add
Returns:
index of the item
Throws:
Exception

addView

protected int addView(OwNavigationView.OwTabInfo info_p,
                      String strViewName_p)
               throws Exception
add a View to the navigation module.
In addition to addMenuItem, the View gets activated and displayed when it is selected in the navigation. The View also becomes child of the navigation module.

Parameters:
strViewName_p - optional Name / ID of the view, can be null.
info_p - item to add, getView must return a valid view
Returns:
index of the item
Throws:
Exception

clear

public void clear()
clears all the added views in which this navigation view is navigating. I.e. clears the OwTabInfo list


enable

public void enable(int iIndex_p,
                   boolean fEnable_p)
enable specified menu items

Parameters:
iIndex_p - index of menu item to enable / disable
fEnable_p - true enables menu item, false disables menu item

enableAll

public void enableAll(boolean fEnable_p)
enables all menu items

Parameters:
fEnable_p - true enables menu item, false disables menu item

getNavigateEventURL

public String getNavigateEventURL(int iIndex_p)
event URL to navigate through the tabs NOTE: If a form is used, the EventURL contains '' primes. So you must enclose the URL in quotas "".

Parameters:
iIndex_p - index of the requested tab.

getNavigationFormAction

public String getNavigationFormAction(int iIndex_p)
get the action string to be inserted into a form, which will then submit a request equal to the button index

Parameters:
iIndex_p - int button index of the button to be activated upon form submit
Returns:
String action URL

getNavigationIndex

public int getNavigationIndex()
get the currently selected navigation index, form multiple views panel

Returns:
int index of current view

getTabList

public List getTabList()
get the tab information for each navigation / menu element


getViewReference

public OwBaseView getViewReference()
get the reference to the active view


isLastTabIndex

public boolean isLastTabIndex(int i_p)
check if the given index is the last one

Returns:
boolean true = last or beyond last one, false = otherwise

isPreviousPanelValid

public boolean isPreviousPanelValid(int iIndex_p)
check if previous panel is valid

Parameters:
iIndex_p - index of the current panel
Returns:
boolean

navigate

public void navigate(int iIndex_p)
              throws Exception
navigate to the selected view index. Only for multiple view navigations, not for menus!

Parameters:
iIndex_p - the index of the view to be navigated to
Throws:
Exception

navigate

public void navigate(String strTargetID_p)
              throws Exception
navigate to the selected view with the given target ID. Only for multiview navigations, not for menus

Parameters:
strTargetID_p - the target ID of the view to navigate to
Throws:
Exception

navigateFirst

public void navigateFirst()
                   throws Exception
navigate to the first error free view

Throws:
Exception

onFormEvent

public void onFormEvent(javax.servlet.http.HttpServletRequest request_p)
                 throws Exception
called before a form event is caught. Method gets called before the event handler to inform neighbor controls / views

Overrides:
onFormEvent in class OwEventTarget
Parameters:
request_p - HttpServletRequest
Throws:
Exception - if OwEventTarget.getFormTarget() update call fails

onNavigate

public void onNavigate(javax.servlet.http.HttpServletRequest request_p)
                throws Exception
event called when user clicked a tab

Parameters:
request_p - HttpServletRequest
Throws:
Exception

onRender

protected void onRender(Writer w_p)
                 throws Exception
render the navigation bar

Overrides:
onRender in class OwView
Parameters:
w_p - Writer object to write HTML to
Throws:
Exception

renderCurrentView

public void renderCurrentView(Writer w_p)
                       throws Exception
render the currently selected view

Parameters:
w_p - Writer object to write HTML to
Throws:
Exception

renderNavigationLink

public void renderNavigationLink(Writer w_p,
                                 OwNavigationView.OwTabInfo tabInfo_p,
                                 int index_p,
                                 int last_p,
                                 int selected_p)
                          throws Exception
render a single navigation tab

Parameters:
w_p - Writer object to write HTML to
tabInfo_p - info to the tab (view...)
index_p - zerobased index of the tab
last_p - last index
selected_p - selected index
Throws:
Exception

setValidatePanels

public void setValidatePanels(boolean fValidatePanels_p)
flag indicating if panels should be validated


size

public int size()
get the number of views to navigate


getTitle

public String getTitle()
Description copied from class: OwView
overridable title of the view

Specified by:
getTitle in interface OwBaseView
Overrides:
getTitle in class OwView
Returns:
String localized display name for the view


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.