KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > api > scenario > Scenario


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.xml.api.scenario;
20
21 import javax.swing.event.ChangeListener JavaDoc;
22 import java.beans.PropertyChangeListener JavaDoc;
23 import org.openide.loaders.DataObject;
24
25 /**
26  * <p>
27  * All scenarios should implement this interface.
28  * A scenario implementation is created by a ScenarioFactory.
29  * </p>
30  * <p><b>NOTE:</b></p>
31  * <ul>
32  * <li>All implementations are required to be serializable.</li>
33  * <li>The toString() method of an implementation should return the name property
34  * of this scenario</li>
35  * </ul>
36  *
37  * @author asgeir@dimonsoftware.com
38  * @deprecated Experimantal SPI
39  */

40 public interface Scenario {
41     
42     public static final String JavaDoc PROP_SCENARIO_MODIFIED = "SCENARIO_MODIFIED";
43     
44     /**
45      * Registers PropertyChangeListener to receive events.
46      * @param listener The listener to register.
47      */

48     public void addPropertyChangeListener(PropertyChangeListener JavaDoc listener);
49     
50     /**
51      * Removes PropertyChangeListener from the list of listeners.
52      * @param listener The listener to remove.
53      */

54     public void removePropertyChangeListener(PropertyChangeListener JavaDoc listener);
55     
56     /**
57      * This method returns the a UI component which can be used to
58      * customize this scenario. To update changes done in the UI panel,
59      * the saveChanges() method can be called.
60      * A new or initialized instance of Component should be returned every
61      * time this method is called.
62      * @param dataObject The DataObject which owns this scenario
63      * @param activatePropertyChange a flag that determines if PropertyChangeEvents are fired
64      * @return A Component which can be used to customize this scenario
65      */

66     public java.awt.Component JavaDoc getCustomizer(DataObject dataObject, boolean activatePropertyChange);
67     
68     /**
69      * Executes the DataObject using this scenario.
70      * @param dataObject the DataObject to execute.
71      */

72     public void execute(DataObject dataObject);
73     
74     /**
75      * Get the name of this scenario
76      * @return The name of this scenario
77      */

78     public String JavaDoc getName();
79     
80     /**
81      * Set the name of this scenario
82      * @param name The name of this scenario
83      */

84     public void setName(String JavaDoc name);
85     
86     /**
87      * Update this scenario with changes done by the last UI
88      * component returned by the getUIComponent() method.
89      */

90     public void saveChanges();
91     
92 }
93
Popular Tags