at.spardat.xma.page.EmbeddedPage 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
*******************************************************************************/
/*
* Created on 11.08.2003
*/
package at.spardat.xma.page;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import at.spardat.xma.component.ComponentClient;
/**
* This class is the base class of all pages which are shown as part of another page.
* The main page of each {@link at.spardat.xma.component.EmbeddableComponent} will be an EmbeddedPage.
*
* @author s2877
*/
public abstract class EmbeddedPage extends PageClient {
// IDialog dialog;
/**
* Constructor of the EmbeddedPage.
*
* @param component the component containing this page.
* @param stateless indicating if this page is stateless on the server.
*/
public EmbeddedPage (ComponentClient component, boolean stateless) {
super (component,stateless);
}
/**
* Constructor of the EmbeddedPage.
*
* @param parent the parentpage of this page. parent must not be null.
* @param stateless indicating if this page is stateless on the server.
*/
public EmbeddedPage (PageClient parent, boolean stateless) {
super (parent,stateless);
}
// /**
// * Get the DialogPage of this Page.
// *
// * @return this.
// */
// public IDialog getDialog() {
// return dialog;
// }
/**
* Creates the SWT-Composite of the EmbeddedPage. All SWT-Widgets of this PageClient
* will be children of this Composite (directly or indirectly).
*
* @param parentComp the SWT-Composite to use as parent of the created SWT-Composite.
* @return the newly created SWT-Composite corresponding to this EmbeddedPage
*/
public Composite createComposite(Composite parentComp) {
composite = new Composite(parentComp, SWT.NONE);
composite.setData(this);
// if(getDialog()==null) {
// //determine dialog
// Composite com;
// for(com=composite;com!=null&&!(com instanceof Shell);com=com.getParent());
// if(com!=null) {
// setDialog((IDialog)com.getData());
// }
// }
return composite;
}
/**
* Creates the Widgets of the PageClient and all Subpages by calling
* {@link #createWidgets()} on the PageClient and all Subpages.
*/
public void initGUI() {
if(!hasModels()) {
createModels();
}
super.initGUI();
if(!isUIAttached()) {
attachUI();
}
}
}