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

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

There is a newer version: 6.0.2
Show newest version
/*******************************************************************************
 * Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH .
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     s IT Solutions AT Spardat GmbH - initial API and implementation
 *******************************************************************************/

/*
 * @(#) $Id: TreeMenuAppShell.java 9562 2012-05-15 14:44:36Z hoenninger $
 *
 *
 *
 *
 */
package at.spardat.xma.appshell;

import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;

import at.spardat.xma.component.ComponentClient;
import at.spardat.xma.page.PageClient;

/**
 * An AppShell implementing the menu tree with a SWT-Tree and the
 * visualization of the context strings with a SWT-List.
 * This class is to be thought to be subclassed by an application specific implementation.
 * @author s2877
 * @since 1.4.0
 */
public abstract class TreeMenuAppShell extends CompositeMenuAppShell implements ITreeItemCreator {
    /**
     * 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 TreeMenuAppShell(ComponentClient component, boolean stateless, int style) {
        super(component, stateless, style);
        addDelegate(createTreeMenuAppShellDelegate());        
    }

    /**
     * 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 TreeMenuAppShell(ComponentClient component, Shell parentShell, boolean stateless, int style) {
        super(component,parentShell,stateless,style);
    }

    /**
     * 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 TreeMenuAppShell(PageClient parent, boolean stateless, int style) {
        super(parent,stateless,style);
    }
    
    /**
     * Creates the TreeMenuAppShellDelegate
     *     
     * @param treeMenuComposite
     * @param clientComposite
     * @param contextComp
     * @return
     */
    protected TreeMenuAppShellDelegate createTreeMenuAppShellDelegate() {
        return new InnerTreeMenuAppShellDelegate();
    }    
    
    // TODO: comment me
    public TreeItem createTreeItem ( TreeItem parent, int style, int index ) {
        return null;
    }

    // TODO: comment me
    public TreeItem createTreeItem ( Tree tree, int style, int index ) {
        return null;
    }
    
    protected class InnerTreeMenuAppShellDelegate extends TreeMenuAppShellDelegate {
        public ITask createRootTask(IMenuItem rootMenu) { return TreeMenuAppShell.this.createRootTask(rootMenu); }
        protected Composite getMenuComp() { return TreeMenuAppShell.this.getMenuComp(); }
        public Composite getClientComposite() { return TreeMenuAppShell.this.getClientComposite(); } 
        protected Composite getContextComp() { return TreeMenuAppShell.this.getContextComp(); } 
    };    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy