at.spardat.xma.appshell
Class MenuAppShell

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.MenuAppShell
All Implemented Interfaces:
Descriptive, IAppShell, at.spardat.xma.boot.component.IDialog, IDialogPage, IEmbeddable, at.spardat.xma.boot.component.IXMAControl, Synchronization, Transactional

public abstract class MenuAppShell
extends ContextAppShell

An AppShell implementing the menu as SWT menu at the shellbar (Windows standard menu). This class is to be thought to be subclassed by an application specific implementation.

Since:
version_number

Field Summary
protected  org.eclipse.swt.widgets.Menu menuW
          This variable holds the root menu.
 
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
MenuAppShell(ComponentClient component, boolean stateless, int style)
           
 
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  org.eclipse.swt.widgets.Menu getMenu()
          Creates the Menu which serves as the root menu widget and is set at: menuW.
 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)
          Marks the named MenuItem as selected.
protected  void menuWSelected(org.eclipse.swt.widgets.MenuItem aMenuItem)
          Event-method called, when an item in the menu 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.Menu menuW
This variable holds the root menu.

Constructor Detail

MenuAppShell

public MenuAppShell(ComponentClient component,
                    boolean stateless,
                    int style)
Method Detail

getMenu

protected org.eclipse.swt.widgets.Menu getMenu()
Creates the Menu which serves as the root menu widget and is set at: menuW. In the MenuAppShell's implementation a Menu of the style SWT.BAR at the Shell's top is created. This method can be overritten if some other kind of menu should be used as root for the MenuItems (like a pop-up menu). Altough this method can be overritten it is only to call by the XMA framework.

Returns:
the Menu used as root for the MenuItems.

initGUI

public void initGUI()
Creates the Widgets of the PageClient and all Subpages by calling PageClient.createWidgets() on the PageClient and all Subpages.

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

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 menu at the shellbar. The change is propagated to the GUI. If the item has no parent then it is atached to the bar menu. If the item has a parent (which is a item itself) then it is atached to the parent's menu. If the parent has no menu then there is one created.

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

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(org.eclipse.swt.widgets.MenuItem aMenuItem)
Event-method called, when an item in the menu is selected. Calls the Task of the corresponding MenuItem.


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)
Marks the named MenuItem as selected. When the receiver is of type CHECK or RADIO, it is selected when it is checked.

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