at.spardat.xma.appshell
Class TreeMenuAppShell

java.lang.Object
  extended byat.spardat.xma.page.Page
      extended byat.spardat.xma.page.PageClient
          extended byat.spardat.xma.page.DialogPage
              extended byat.spardat.xma.appshell.AppShell
                  extended byat.spardat.xma.appshell.ContextAppShell
                      extended byat.spardat.xma.appshell.TreeMenuAppShell
All Implemented Interfaces:
Descriptive, IAppShell, at.spardat.xma.boot.component.IDialog, IDialogPage, IEmbeddable, at.spardat.xma.boot.component.IXMAControl, Synchronization, Transactional

public abstract class TreeMenuAppShell
extends ContextAppShell

An AppShell implementing the menu tree with a SWT-Tree and the visualisation of the context strings with a SWT-List. This class is to be thought to be subclassed by an application specific implementation.

Since:
1.4.0

Field Summary
protected  org.eclipse.swt.widgets.Tree menuW
          swt-tree containing the menu items.
 
Fields inherited from class at.spardat.xma.appshell.ContextAppShell
contextW
 
Fields inherited from class at.spardat.xma.appshell.AppShell
rootMenu, rootTask
 
Fields inherited from class at.spardat.xma.page.DialogPage
statusBar, statusBarComposite
 
Fields inherited from class at.spardat.xma.page.PageClient
composite
 
Constructor Summary
TreeMenuAppShell(ComponentClient component, boolean stateless, int style)
          Initializes the application shell.
 
Method Summary
 void attachMenu(IMenuItem item)
          Attach the given MenuItem to its viusal representation.
protected  void clientEventBase(org.eclipse.swt.events.SelectionEvent event, int type)
          Calls the clientevent configured for the widget of the event by calling PageClient.clientEvent(SelectionEvent,int).
 void detachMenu(IMenuItem item)
          Detach the MenuItem from its visual representation.
protected abstract  org.eclipse.swt.widgets.Composite getMenuComp()
          Get the swt-composite for holding the menu items.
 void initGUI()
          Creates the Widgets of the PageClient and all Subpages by calling PageClient.createWidgets() on the PageClient and all Subpages.
 void markMenu(java.lang.String menuId)
          Visibly marks the named MenuItem as selected.
protected  void menuWSelected()
          Event-method called, when an item in the menu-tree is selected.
 void removeWidgetsBase()
          Notify the PageClient and all Subpages, that the Widgets are disposed by calling PageClient.removeWidgets() on all Subpages and the PageClient.
 void selectMenu(java.lang.String menuId)
          Selects the named MenuItem.
protected  void setMenuEnabled(boolean enabled)
          Completely enable/disable the menu.
 
Methods inherited from class at.spardat.xma.appshell.ContextAppShell
contextStringChanged, getContextComp, showContextStack
 
Methods inherited from class at.spardat.xma.appshell.AppShell
callMenu, callMenu, clearClientArea, close, closeCancel, closeOK, closeTasks, createRootTask, createTask, exit, getClientComposite, getMenu, getMenuResource, getTopTask, hasWidgets, invoke, leaveBase, lockMenu, pushClientComponent, registerMenu, setClientArea, unlockMenu, unregisterMenu
 
Methods inherited from class at.spardat.xma.page.DialogPage
clearError, clearInfo, clearValidationErrorImpl, clearWarning, createComposite, getDialog, getErrorCount, getExitstatus, getFocusControl, getShell, hasValidationError, isVisible, overrideErrorsFromModel, setError, setFocus, setFocusControl, setInfo, setRerunStateChanched, setValidationErrorImpl, setWarning, stateChangedBase, updateErrorStatus
 
Methods inherited from class at.spardat.xma.page.PageClient
activatePage, addChild, attachUI, attachUIImpl, clientEvent, createModels, createWidgets, detachUI, determineState, determineStateBase, enter, enterBase, getComponent, getComposite, getContextString, getCurrentEvent, getDialogPage, getExtend, getHelpUri, getHelpUriBase, getParent, getWidgets, hasModels, helpEvent, insertLangInFilename, isEventsEnabled, isNew, isUIAttached, launch, launchExtern, launchRelative, leave, newRemoteCall, removeChild, removeModel, removeWidgetModels, removeWidgets, rpcFinished, serverEvent, setContextString, setDialog, setEditable, setError, setEventsEnabled, setExtend, setId, setNew, setValidationErrorImpl, showException, showMessage, stateChanged, stateChangedBaseImpl, stateChangedExtend, toLocalizedHelpUri
 
Methods inherited from class at.spardat.xma.page.Page
changed, commit, describe, display, equalsCS, externalize, getId, getNumWModels, getTypeId, getWModel, getWModels, internalize, isAtServer, isStateless, randomlyChange, rollback, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface at.spardat.xma.page.IDialogPage
clearInfo, clearValidationErrorImpl, clearWarning, hasValidationError, overrideErrorsFromModel, setFocus, setInfo, setValidationErrorImpl, setWarning
 
Methods inherited from interface at.spardat.xma.boot.component.IDialog
clearError, getErrorCount, getFocusControl, getShell, setError, setFocusControl, updateErrorStatus
 
Methods inherited from interface at.spardat.xma.boot.component.IXMAControl
createComposite, enterBase, getComposite, removeModel, stateChangedBase
 
Methods inherited from interface at.spardat.xma.page.IEmbeddable
determineStateBase, getContextString, getDialog, setDialog, setEventsEnabled, stateChangedBaseImpl, stateChangedExtend
 

Field Detail

menuW

protected org.eclipse.swt.widgets.Tree menuW
swt-tree containing the menu items.

Constructor Detail

TreeMenuAppShell

public TreeMenuAppShell(ComponentClient component,
                        boolean stateless,
                        int style)
Initializes the application shell.

Parameters:
component - the Component containing the DialogPage.
stateless - indicating if this page is stateless on the server.
style - The SWT-Style for the Shell of the DialogPage.
Throws:
java.lang.IllegalArgumentException - if comonent is null.
Method Detail

getMenuComp

protected abstract org.eclipse.swt.widgets.Composite getMenuComp()
Get the swt-composite for holding the menu items. It will be filled completely with a tree containing the menu items.

Returns:
the composite for the menu.

initGUI

public void initGUI()
Creates the Widgets of the PageClient and all Subpages by calling PageClient.createWidgets() on the PageClient and all Subpages. Overloaded here to add its own widgets: the SWT-Tree for the menu and the SWT-List for the context stack.

Specified by:
initGUI in interface at.spardat.xma.boot.component.IXMAControl
Overrides:
initGUI in class ContextAppShell

removeWidgetsBase

public void removeWidgetsBase()
Notify the PageClient and all Subpages, that the Widgets are disposed by calling PageClient.removeWidgets() on all Subpages and the PageClient.

Specified by:
removeWidgetsBase in interface at.spardat.xma.boot.component.IXMAControl
Overrides:
removeWidgetsBase in class ContextAppShell

clientEventBase

protected void clientEventBase(org.eclipse.swt.events.SelectionEvent event,
                               int type)
Calls the clientevent configured for the widget of the event by calling PageClient.clientEvent(SelectionEvent,int). Handles the selection events of the menu-tree, too.

Overrides:
clientEventBase in class PageClient
Parameters:
event - the SWT-Event that happened.
type - the type of the Event, as defined by the event type constants in class SWT.

menuWSelected

protected void menuWSelected()
Event-method called, when an item in the menu-tree is selected. Calls the Task of the corresponding MenuItem.


setMenuEnabled

protected void setMenuEnabled(boolean enabled)
Completely enable/disable the menu.

Specified by:
setMenuEnabled in class AppShell
Parameters:
enabled - true: enable, false: disable.

attachMenu

public void attachMenu(IMenuItem item)
Attach the given MenuItem to its viusal representation. The visual representation is implemented by a SWT TreeItem. The change is propagated to the GUI.

Specified by:
attachMenu in class AppShell
Parameters:
item - to attach

detachMenu

public void detachMenu(IMenuItem item)
Detach the MenuItem from its visual representation. The change must be propagated to the GUI.

Specified by:
detachMenu in class AppShell
Parameters:
item - to remove

selectMenu

public void selectMenu(java.lang.String menuId)
Selects the named MenuItem. This method behaves like the user has selected the MenuItem via the GUI.

Specified by:
selectMenu in interface IAppShell
Specified by:
selectMenu in class AppShell
Parameters:
menuId - the name of the MenuItem to select.

markMenu

public void markMenu(java.lang.String menuId)
Visibly marks the named MenuItem as selected.

Specified by:
markMenu in interface IAppShell
Specified by:
markMenu in class AppShell
Parameters:
menuId - the name of the MenuItem to mark as selected.