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

at.spardat.xma.boot.component.IComponent Maven / Gradle / Ivy

/*******************************************************************************
 * 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 04.07.2003
 *
 */
package at.spardat.xma.boot.component;

import java.beans.PropertyChangeListener;
import java.util.Properties;

import org.eclipse.swt.widgets.Composite;

/**
 * This class defines the interface common for all cliend side components.
 *
 * Application data can be exchanged between components via name-value-pairs.
 * Each component defines its own set of name-value-pairs which are supported
 * by the component. Such name-value-pairs are called properties here.
 *
 * @author s2877
 */
public interface IComponent {

    /**
     * Adds a ComponentListner to the listeners of the component. All listeners
     * are notified of all property-changes and component-events.
     *
     * @param listener the new listener to register
     */
    void addEventListener(IComponentListener listener);

    /**
     * Remove a ComponentListener form the listners of the component. This
     * ComponentListner will not be notified of propertiy-changes and component-events
     * any more.
     * @param listener the ComponentListener to remove
     */
    void removeEventListener(IComponentListener listener);

    /**
      * Adds a PropertyChangeListener to the listeners of the component. All listeners
      * are notified of all property-changes.
      *
      * @param listener the new listener to register
      */
    public void addPropertyChangeListener(PropertyChangeListener listener);

    /**
     * Remove a PropertyChangeListener form the listners of the component. This
     * PropertyChangeListener will not be notified of propertiy-changes
     * any more.
     * @param listener the PropertyChangeListener to remove
     */
    public void removePropertyChangeListener(PropertyChangeListener listener);

    /**
     * Sets all properties of the component. This method completly
     * resets the set of properties of the component to the set given
     * as input.
     * If there are registered ComponentListeners, all ComponentListeners
     * are notifyed of each property-change.
     *
     * @param input the new set of properties
     */
    void setProperties(Properties input);

    /**
     * Sets one property of the component.
     * If there are registered ComponentListeners and the value of the
     * property is differend from its old value, all ComponentListeners
     * are notifyed of the property-change.
     *
     * @param name the name of the property to change
     * @param value the new value of the property
     */
    void setProperty(String name, String value);

    /**
     * Gives the value of a property. If the property is not defined
     * null is returned.
     *
     * @param name the name of the property
     * @return the value of the named property
     */
    String getProperty(String name);

    /**
     * Gives all properties of the component.
     * @return the properties of the component.
     */
    Properties getProperties();

    /**
     * This method is called to start the Component on the
     * client side. This method must be implemented by the application programmer.
     * It will typicaly create a DialogPage, copy some input data into
     * the Page and start the DialogPage by calling DialogPage.invoke().
     *
     * For modal components this method must block until the component is closed.
     * For nonmodal components this method returns imediatly after the component is
     * started.
     *
     * This method must not be called for visually embedded Components.
     *
     * @param parent The shell of the dialog will be created as child of parent.
     */
    void invoke(Composite parent);

    /**
     * Frees all allocated recources of the Component.
     * This includes freeing all still living statefull PageModels at the server
     * and disposing all SWT-resources like Images.
     */
    void dispose();

    /**
     * Get the session of the component.
     * @return the client side session this component belongs to.
     */
    IRtXMASessionClient getRTSession();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy