001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package com.sun.rave.designtime.event;
043:
044: import java.util.EventListener;
045: import com.sun.rave.designtime.DesignBean;
046: import com.sun.rave.designtime.DesignEvent;
047: import com.sun.rave.designtime.DesignProperty;
048:
049: /**
050: * DesignBeanListener is the event listener interface for DesignBeans. These methods are called
051: * when a DesignBean is changed, a DesignProperty is changed (on a DesignBean), or a DesignEvent is
052: * changed (on a DesignBean).
053: *
054: * <P><B>IMPLEMENTED BY THE COMPONENT AUTHOR</B> - This interface is designed to be implemented by
055: * the component (bean) author.</P>
056: *
057: * @author Joe Nuxoll
058: * @version 1.0
059: * @see DesignBean#addDesignBeanListener(DesignBeanListener)
060: */
061: public interface DesignBeanListener extends EventListener {
062:
063: /**
064: * The specified DesignBean's DesignContext has been "activated" in the project
065: *
066: * @param designBean the DesignBean who's DesignContext that has been activated
067: */
068: public void beanContextActivated(DesignBean designBean);
069:
070: /**
071: * The specified DesignBean's DesignContext has been "deactivated" in the project
072: *
073: * @param designBean the DesignBean who's DesignContext that has been deactivated
074: */
075: public void beanContextDeactivated(DesignBean designBean);
076:
077: /**
078: * The specified DesignBean's instance name was changed. This is the source-code instance name
079: * of the bean component.
080: *
081: * @param designBean The DesignBean that has a new instance name
082: * @param oldInstanceName The old instance name
083: */
084: public void instanceNameChanged(DesignBean designBean,
085: String oldInstanceName);
086:
087: /**
088: * The specified DesignBean has changed. This represents a larger-scale change than a single
089: * property - this may be the instance name has changed or some other more-than-just-a-property
090: * aspect of the DesignBean has changed.
091: *
092: * @param designBean The DesignBean that has changed
093: */
094: public void beanChanged(DesignBean designBean);
095:
096: /**
097: * The specified DesignProperty has changed. This could mean that a new value was set, or the
098: * property was 'unset', or anything that results in the DesignProperty being different. The
099: * oldValue will be passed in if applicable and possible.
100: *
101: * @param prop The DesignProperty that has changed
102: * @param oldValue The prior value of the property (may be null)
103: */
104: public void propertyChanged(DesignProperty prop, Object oldValue);
105:
106: /**
107: * The specified DesignEvent has changed. This could mean that the event was hooked, unhooked,
108: * or the handler method name was changed, or anything that results in the DesignEvent being
109: * different.
110: *
111: * @param event The DesignEvent that has changed
112: */
113: public void eventChanged(DesignEvent event);
114: }
|