at.spardat.xma.appshell.ContextAppShell Maven / Gradle / Ivy
The 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
*******************************************************************************/
/*******************************************************************************
* 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: ContextAppShell.java 8695 2011-11-21 18:25:16Z laslovd $
*
*
*
*
*
*/
package at.spardat.xma.appshell;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Shell;
import at.spardat.xma.boot.component.IXMAControl;
import at.spardat.xma.component.ComponentClient;
import at.spardat.xma.page.PageClient;
/**
* An AppShell implementing the visualisation of the context strings with a SWT-List.
* This class is to be thought to be subclassed by other abstract AppShells implementing
* some kind of menu like TreeMenu, SWT menu.
* @author s3460
* @since version_number
*/
public abstract class ContextAppShell extends AppShell {
/**
* 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 ContextAppShell(ComponentClient component, boolean stateless, int style) {
super(component, stateless, style);
}
/**
* 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 ContextAppShell(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 ContextAppShell(PageClient parent, boolean stateless, int style) {
super(parent,stateless,style);
}
/**
* Gets the swt-composite for holding the context strings of the call stack.
* It will be filled completely with a list containing the context stack.
* @return the composite for the context strings.
*/
abstract protected Composite getContextComp();
/**
* Show the contextStrings of all Tasks, Components and Pages on
* the call stack.
*/
public void showContextStack() {
for ( int i = 0; i < delegates.length; i++ ) {
delegates[i].showContextStack();
}
}
/**
* 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.
*/
public void contextStringChanged(IXMAControl source, String newText) {
showContextStack();
}
}