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 com.sun.rave.designtime.DesignBean;
045: import com.sun.rave.designtime.DesignContext;
046: import com.sun.rave.designtime.Position;
047:
048: /**
049: * DesignContextListener is the event listener interface for DesignContexts. These methods are called
050: * when a DesignBean is created, deleted, changed, or moved. This includes the DesignBeanListener
051: * methods as well, so effectively a DesignContextListener is a listener to *all* DesignBeans in a
052: * context.
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: */
060: public interface DesignContextListener extends DesignBeanListener {
061:
062: /**
063: * A DesignContext has been "activated" in the project
064: *
065: * @param context the DesignContext that has been activated
066: */
067: public void contextActivated(DesignContext context);
068:
069: /**
070: * A DesignContext has been "deactivated" in the project
071: *
072: * @param context the DesignContext that has been deactivated
073: */
074: public void contextDeactivated(DesignContext context);
075:
076: /**
077: * Something at the context-level changed. This is a large-grain change like a file rename or
078: * something that cannot be represented by one of the smaller-grain methods.
079: *
080: * @param context DesignContext The DesignContext that changed
081: */
082: public void contextChanged(DesignContext context);
083:
084: /**
085: * A new DesignBean has been created. This corresponds to a new instance bean being dropped from
086: * the palette or programmattically created via the Design-Time API.
087: *
088: * @param designBean DesignBean The newly created DesignBean
089: */
090: public void beanCreated(DesignBean designBean);
091:
092: /**
093: * A DesignBean has been deleted.
094: *
095: * @param designBean DesignBean The DesignBean that was deleted. At this point, it is a goner, so any
096: * manipulations done to the passed bean will be tossed out immediately after this method
097: * returns
098: */
099: public void beanDeleted(DesignBean designBean);
100:
101: /**
102: * A DesignBean was moved either within its parent DesignBean, or to another parent DesignBean.
103: *
104: * @param designBean DesignBean The DesignBean that was moved
105: * @param oldParent DesignBean The old parent DesignBean (my match the new parent)
106: * @param pos Position The new parent DesignBean (may match the old parent)
107: */
108: public void beanMoved(DesignBean designBean, DesignBean oldParent,
109: Position pos);
110: }
|