All Downloads are FREE. Search and download functionalities are using the official Maven repository.

at.spardat.xma.appshell.MultiMenuAppShell Maven / Gradle / Ivy

/*
 * @(#) $Id: MultiMenuAppShell.java 8768 2011-11-23 15:48:49Z laslovd $
 *
 * 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);
    }
    
    protected void addDelegates ( final int tabAlignment ) {
        addDelegate(new MenuAppShellDelegate() {
            public ITask createRootTask(IMenuItem rootMenu) { return createDropDownMenuRootTask(rootMenu); }
            public Composite getClientComposite() { return getDropDownMenuClientComposite(); } 
            protected Composite getContextComp() { return getDropDownContextComp(); } 
        });
        addDelegate(new TreeMenuAppShellDelegate() {
            public ITask createRootTask(IMenuItem rootMenu) { return createTreeMenuRootTask(rootMenu); }
            protected Composite getMenuComp() { return getTreeMenuComp(); }
            public Composite getClientComposite() { return getTreeMenuClientComposite(); } 
            protected Composite getContextComp() { return getTreeContextComp(); } 
        });
        addDelegate(new TabAppShellDelegate(tabAlignment) {
            public ITask createRootTask(IMenuItem rootMenu) { return createTabMenuRootTask(rootMenu); }
            protected Composite getMenuComp() { return getTabMenuComp(); }
            public Composite getClientComposite() { return getTabMenuClientComposite(); } 
            protected Composite getContextComp() { return getTabContextComp(); } 
        });
    }
    
    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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy