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

at.spardat.xma.page.PageServer 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
 *******************************************************************************/


// @(#) $Id: PageServer.java 3240 2009-03-03 16:10:56Z gub $
package at.spardat.xma.page;

import at.spardat.xma.component.ComponentServer;
import at.spardat.xma.mdl.WModel;
import at.spardat.xma.session.XMASession;


/**
 * The server side representation of a page (model)
 *
 * @author YSD, 01.05.2003 21:49:11
 */
public abstract class PageServer extends Page {

    /**
     * The component this page belongs to
     */
    private ComponentServer         component_;

    /**
     * The page id of the parent or -1, if there is no parent.
     */
    private short                   parentId_ = -1;


    /**
     * Constructor
     *
     * @param isStateless property whether this is a server-stateless component
     */
    public PageServer (ComponentServer c, boolean isStateless) {
        super (isStateless, true);
        component_ = c;
    }

    /**
     * Clears all widget model. Just for debugging purpose.
     */
    public void clear () {
        WModel [] wModels = getWModels();
        for (int i=0; inull, if this page has no parent
     */
    public PageServer getParent () {
        if (parentId_ == -1) return null;
        return (PageServer) component_.getPageModel(parentId_);
    }

    /**
     * Estimates the number of bytes this object consumes in memory.
     */
    public int estimateMemory () {
        int         bytes = 0;
        WModel [] wModels = getWModels();
        for (int i=0; i
     *
     * This method must not be called from outside the XMA framework.
     */
    public void setParentId (short s) {
        parentId_ = s;
    }

    /**
     * Sets the given subpage. The method automatically chooses the
     * correct member variable to set.
     * This method will be implemented by the generated class.
     * @param child the subpage to set.
     * @throws IllegalArgumentException if no corresponding member exists
     *          for the type of the subpage
     */
    public void setChild(PageServer child) {
        throw new IllegalArgumentException(getClass().getName()+" has no child of type "+child.getClass().getName());
    }

    /**
     * Removes the given subpage. The method automatically chooses the
     * correct member variable to clear.
     * This method will be implemented by the generated class.
     * @param child the subpage to set.
     * @throws IllegalArgumentException if no corresponding member exists
     *          for the type of the subpage
     */
    public void removeChild(PageServer child) {
        throw new IllegalArgumentException(getClass().getName()+" has no child of type "+child.getClass().getName());
    }

    /**
     * returns the XMASession this page belongs to
     * @since 2.1.0
     */
    public XMASession getSession() {
		return getComponent().getSession();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy