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

at.spardat.xma.appshell.IAppShell 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: IAppShell.java 8540 2011-09-23 08:56:00Z laslovd $
 *
 * 
 * 
 * 
 */
package at.spardat.xma.appshell;

import org.eclipse.swt.widgets.Composite;

import at.spardat.xma.boot.component.IXMAControl;
import at.spardat.xma.page.IDialogPage;

/**
 * Interface for {@link AppShell}. An application shell is the window opened at startup
 * of the client side application. It stays open during the whole user session. It typically contains
 * a header area showing some context information, a menu area containing the menu tree of the
 * application and a client area showing the currently active component.
 * 
 * @author s2877
 * @since 1.4.0
 */
public interface IAppShell {

    /**
     * Get the SWT-composite where client pages or composites
     * can be embedded.
     * @return  the composite representing the client area.
     */
    Composite getClientComposite();
    
    /**
     * Pushes the given Component or Page on top of the call stack.
     * It is shown embedded in the client area.
     * If modal is true, this method blocks until the Component or Page is
     * closed.
     * @param newClient the component or page to embedd.
     * @param modal if modal is true this method blocks util newClient is finished
     *              if modla if false this method reuturns imediatly.
     */
    void pushClientComponent(IXMAControl newClient,boolean modal);

    /**
     * Notifies the AppShell of a change in the context-string of a component or page.
     * Propagates the change to the GUI.
     * @param source the component or page which changed its context string.
     * @param newText the new context string of the source.
     */
    void contextStringChanged(IXMAControl source,String newText);
    
    /**
     * Show the contextStrings of all Tasks, Components and Pages on
     * the call stack.
     */
    void showContextStack();

    /**
     * Replaces the embedded page or component in the client area. The currently embedded
     * page or component is removed from this AppShell and the new one is shown in
     * the client area.
     * @param newClient the new page or component to embedd.
     */
    void setClientArea(IXMAControl newClient);
    
    /**
     * Removes the embedded page or componet form the client area.
     * Nothing is embedded afterwards.
     */
    void clearClientArea();
    

    /**
     * Get the task on top of the call stack. This is the currently active Task.
     */
    public ITask getTopTask();

    /**
     * Locks and disables the menu. Internaly increments a lock counter.
     * To unlock the menu again unlockMenu() must be called as often
     * as lockMenu().
     */
    void lockMenu();
    
    /**
     * Unlocks the menu. Internaly decrements a lock counter.
     * To unlock the menu unlockMenu() must be called as often
     * as lockMenu() before.
     */
    void unlockMenu();
    
    
    
    
    /**
     * Determine if the AppShell still contains widgets. Can be used to
     * test if it is disposed.
     * @return true if it has widgets.
     */
    boolean hasWidgets();

    /**
     * Calls the action associated which the given MenuItem.
     * Before it is actually called, all currently open Tasks
     * outside the given MenuItem are closed.
     * @param item the MenuItem to call.
     */
    void callMenu(IMenuItem item);

    /**
     * Calls the action associated which the named MenuItem.
     * Before it is actually called, all currently open Tasks
     * outside the named MenuItem are closed.
     * @param menuId the name of the MenuItem to call.
     */
    void callMenu(String menuId);

    /**
     * Selects the named MenuItem. This method behaves like
     * the user has selected the MenuItem via the GUI. 
     * @param menuId the name of the MenuItem to select.
     */
    void selectMenu(String menuId);

    /**
     * Visibly marks the named MenuItem as selected.
     * @param menuId the name of the MenuItem to mark as selected.
     */
    void markMenu(String menuId);
 
    /**
     * Register the given MenuItem at the AppShell.
     * After this, the MenuItem will be attached to
     * its visual representation. It will be visible
     * and events will be delivered.
     * @param item
     */        
    void registerMenu(IMenuItem item);

    /**
     * Unregister the given MenuItem fromt the AppShell.
     * After this, the MenuItem will no longer be attached
     * to its visual representation. It will not be
     * visible and no events will be delivered any more.
     * @param item
     */
    void unregisterMenu(IMenuItem item);



    /**
     * Creates the Task with the given name. 
     * @param name unique name for the task within the client side application.
     */
    public ITask createTask(String name);
  
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy