at.spardat.xma.appshell.MultiMenuAppShell Maven / Gradle / Ivy
The newest version!
/*
* @(#) $Id: MultiMenuAppShell.java 9396 2012-04-24 20:36:12Z hoenninger $
*
* Copyright 2009/2010 by sIT Solutions,
* A-1110 Wien, Geiselbergstr.21-25.
* All rights reserved.
*
*/
package at.spardat.xma.appshell;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import at.spardat.xma.component.ComponentClient;
import at.spardat.xma.page.PageClient;
// TODO: comment me
public abstract class MultiMenuAppShell extends CompositeMenuAppShell {
/**
* Initializes an AppShell.
*
* @param component the Component containing the DialogPage.
* @param stateless indicating if this page is stateless on the server.
* @param style The SWT-Style for the Shell of the DialogPage.
* @param tabAlignment defines the alignment of the tab menu (SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT)
* @throws IllegalArgumentException if component is null.
*/
public MultiMenuAppShell ( ComponentClient component, boolean stateless, int style, final int tabAlignment ) {
super(component,stateless,style);
addDelegates(tabAlignment);
}
/**
* Initializes an AppShell inside a given Component.
*
* @param component the Component containing the DialogPage.
* @param parentShell the Shell which shall be the parent of the Shell of the DialogPage.
* @param style The SWT-Style for the Shell of the DialogPage.
* @param stateless indicating if this page is stateless on the server.
* @param tabAlignment defines the alignment of the tab menu (SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT)
* @throws IllegalArgumentException if component is null.
*/
public MultiMenuAppShell(ComponentClient component, Shell parentShell, boolean stateless, int style, final int tabAlignment ) {
super(component,parentShell,stateless,style);
addDelegates(tabAlignment);
}
/**
* Initializes an AppShell inside the same Component as the parent PageClient.
*
* @param parent the PageClient calling this DialogPage.
* @param stateless indicating if this page is stateless on the server.
* @param style The SWT-Style for the Shell of the DialogPage.
* @param tabAlignment defines the alignment of the tab menu (SWT.LEFT_TO_RIGHT or SWT.RIGHT_TO_LEFT)
*/
public MultiMenuAppShell(PageClient parent, boolean stateless, int style, final int tabAlignment ) {
super(parent,stateless,style);
addDelegates(tabAlignment);
}
/**
* Initializes an AppShell.
*
* @param component the Component containing the DialogPage.
* @param stateless indicating if this page is stateless on the server.
* @param style The SWT-Style for the Shell of the DialogPage.
* @throws IllegalArgumentException if component is null.
*/
public MultiMenuAppShell ( ComponentClient component, boolean stateless, int style ) {
this(component,stateless,style,SWT.LEFT_TO_RIGHT);
}
/**
* Initializes an AppShell inside a given Component.
*
* @param component the Component containing the DialogPage.
* @param parentShell the Shell which shall be the parent of the Shell of the DialogPage.
* @param style The SWT-Style for the Shell of the DialogPage.
* @param stateless indicating if this page is stateless on the server.
* @throws IllegalArgumentException if component is null.
*/
public MultiMenuAppShell(ComponentClient component, Shell parentShell, boolean stateless, int style ) {
this(component,parentShell,stateless,style,SWT.LEFT_TO_RIGHT);
}
/**
* Initializes an AppShell inside the same Component as the parent PageClient.
*
* @param parent the PageClient calling this DialogPage.
* @param stateless indicating if this page is stateless on the server.
* @param style The SWT-Style for the Shell of the DialogPage.
*/
public MultiMenuAppShell(PageClient parent, boolean stateless, int style ) {
this(parent,stateless,style,SWT.LEFT_TO_RIGHT);
}
/**
* Creates the MenuAppShellDelegate
*
* @param clientComposite
* @param contextComp
* @return
*/
protected MenuAppShellDelegate createMenuAppShellDelegate() {
return new InnerMenuAppShellDelegate();
}
/**
* Creates the TreeMenuAppShellDelegate
*
* @param treeMenuComposite
* @param clientComposite
* @param contextComp
* @return
*/
protected TreeMenuAppShellDelegate createTreeMenuAppShellDelegate() {
return new InnerTreeMenuAppShellDelegate();
}
/**
* Creates the TabAppShellDelegate
*
* @param tabAlignment
* @param tabMenuComposite
* @param clientComposite
* @param contextComp
* @return
*/
protected TabAppShellDelegate createTabAppShellDelegate(int tabAlignment) {
return new InnerTabAppShellDelegate(tabAlignment);
}
protected void addDelegates ( final int tabAlignment ) {
addDelegate(createMenuAppShellDelegate());
addDelegate(createTreeMenuAppShellDelegate());
addDelegate(createTabAppShellDelegate(tabAlignment));
}
public Composite getClientComposite () {
return null;
}
protected Composite getTabMenuClientComposite () {
return getClientComposite();
}
protected Composite getTreeMenuClientComposite () {
return getClientComposite();
}
protected Composite getDropDownMenuClientComposite () {
return getClientComposite();
}
protected ITask createDropDownMenuRootTask ( IMenuItem rootMenu ) {
return null;
}
protected ITask createTreeMenuRootTask ( IMenuItem rootMenu ) {
return null;
}
protected ITask createTabMenuRootTask ( IMenuItem rootMenu ) {
return null;
}
protected Composite getTreeMenuComp () {
return null;
}
protected Composite getTabMenuComp () {
return null;
}
protected Composite getDropDownContextComp() {
return null;
}
protected Composite getTreeContextComp() {
return null;
}
protected Composite getTabContextComp() {
return null;
}
final protected Composite getMenuComp () {
return null;
}
final protected Composite getContextComp() {
return null;
}
final public ITask createRootTask ( IMenuItem rootMenu ) {
return null;
}
protected class InnerMenuAppShellDelegate extends MenuAppShellDelegate {
public ITask createRootTask(IMenuItem rootMenu) { return createDropDownMenuRootTask(rootMenu); }
public Composite getClientComposite() { return getDropDownMenuClientComposite(); }
protected Composite getContextComp() { return getDropDownContextComp(); }
};
protected class InnerTreeMenuAppShellDelegate extends TreeMenuAppShellDelegate {
public ITask createRootTask(IMenuItem rootMenu) { return createTreeMenuRootTask(rootMenu); }
protected Composite getMenuComp() { return getTreeMenuComp(); }
public Composite getClientComposite() { return getTreeMenuClientComposite(); }
protected Composite getContextComp() { return getTreeContextComp(); }
};
protected class InnerTabAppShellDelegate extends TabAppShellDelegate {
public InnerTabAppShellDelegate(int tabAlignment) { super(tabAlignment); };
public ITask createRootTask(IMenuItem rootMenu) { return createTabMenuRootTask(rootMenu); }
protected Composite getMenuComp() { return getTabMenuComp(); }
public Composite getClientComposite() { return getTabMenuClientComposite(); }
protected Composite getContextComp() { return getTabContextComp(); }
};
}