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;
043:
044: /**
045: * <p>The CustomizerResult is a special Result object that triggers the customizer dialog to be
046: * displayed. This Result object can be returned from any component-author operation and thus pop
047: * up a customizer dialog. Common uses include a context-menu item, which allows a right-click menu
048: * item to launch a customizer, and a return value from a beanCreated method to pop up the
049: * customizer dialog just as a component is dropped from the palette.</p>
050: *
051: * @author Joe Nuxoll
052: * @version 1.0
053: * @see Customizer2
054: * @see Result
055: */
056: public class CustomizerResult extends Result {
057:
058: /**
059: * Constructs a CustomizerResult without a DesignBean or Customizer2 (which must be
060: * specified via 'setDesignBean(...)' and 'setCustomizer(...)' before being returned).
061: */
062: public CustomizerResult() {
063: super (true);
064: }
065:
066: /**
067: * Constructs a CustomizerResult with the specified DesignBean and no Customizer2 (which
068: * must be specified via 'setCustomizer2' before being returned).
069: */
070: public CustomizerResult(DesignBean customizeBean) {
071: super (true);
072: this .customizeBean = customizeBean;
073: }
074:
075: /**
076: * Constructs a CustomizerResult with the specified DesignBean and Customizer2
077: */
078: public CustomizerResult(DesignBean customizeBean,
079: Customizer2 customizer) {
080: this (customizeBean);
081: this .customizer = customizer;
082: }
083:
084: /**
085: * Storage for the 'customizeBean' property
086: */
087: protected DesignBean customizeBean;
088:
089: /**
090: * Sets the 'customizeBean' property
091: *
092: * @param customizeBean DesignBean the desired DesignBean to be customized
093: */
094: public void setCustomizeBean(DesignBean customizeBean) {
095: this .customizeBean = customizeBean;
096: }
097:
098: /**
099: * Retrieves the 'customizeBean' property
100: *
101: * @return the current value of the 'customizeBean' property
102: */
103: public DesignBean getCustomizeBean() {
104: return customizeBean;
105: }
106:
107: /**
108: * Storage for the 'customizer' property
109: */
110: protected Customizer2 customizer;
111:
112: /**
113: * Sets the 'customizer' property
114: *
115: * @param customizer the desired Customizer2 to use on this DesignBean
116: */
117: public void setCustomizer(Customizer2 customizer) {
118: this .customizer = customizer;
119: }
120:
121: /**
122: * Retrieves the 'customizer' property
123: *
124: * @return the current value of the 'customizer' property
125: */
126: public Customizer2 getCustomizer() {
127: return customizer;
128: }
129: }
|