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 org.netbeans.modules.uml.ui.controls.newdialog;
043:
044: import java.util.Vector;
045:
046: import org.netbeans.modules.uml.core.metamodel.core.foundation.INamespace;
047: import org.netbeans.modules.uml.core.metamodel.core.foundation.IElement;
048: import org.netbeans.modules.uml.core.metamodel.diagrams.IDiagramKind;
049: import org.netbeans.modules.uml.ui.support.NewPackageKind;
050:
051: /**
052: * @author sumitabhk
053: *
054: */
055: public class NewDialogPackageDetails implements
056: INewDialogPackageDetails {
057: private String m_Name;
058: private INamespace m_Namespace;
059: private Vector<IElement> m_AdditionalNamespaces;
060: private boolean m_CreateScopedDiagram;
061: private String m_ScopedDiagramName;
062: private int /*NewPackageKind*/m_PackageKind;
063: private boolean m_AllowFromRESelection;
064: private int /*DiagramKind*/m_DiagramKind;
065:
066: /**
067: *
068: */
069: public NewDialogPackageDetails() {
070: super ();
071: m_CreateScopedDiagram = false;
072: m_PackageKind = NewPackageKind.NPKGK_PACKAGE;
073: m_AllowFromRESelection = true;
074: m_DiagramKind = IDiagramKind.DK_CLASS_DIAGRAM;
075: }
076:
077: /**
078: * Name of the package.
079: *
080: * @param pVal[out]
081: *
082: * @return HRESULT
083: */
084: public String getName() {
085: return m_Name;
086: }
087:
088: /**
089: * Name of the package.
090: *
091: * @param pVal[out]
092: *
093: * @return HRESULT
094: */
095: public void setName(String value) {
096: m_Name = value;
097: }
098:
099: /**
100: * The namespace this package will occupy.
101: *
102: * @param pVal[out]
103: *
104: * @return HRESULT
105: */
106: public INamespace getNamespace() {
107: return m_Namespace;
108: }
109:
110: /**
111: * The namespace this package will occupy.
112: *
113: * @param pVal[out]
114: *
115: * @return HRESULT
116: */
117: public void setNamespace(INamespace value) {
118: m_Namespace = value;
119: }
120:
121: /**
122: * Add an additional namespace to our list of possible namespaces.
123: *
124: * @param pNamespace[in]
125: *
126: * @return HRESULT
127: */
128: public long addNamespace(INamespace pNamespace) {
129: if (pNamespace instanceof IElement) {
130: if (m_AdditionalNamespaces == null) {
131: m_AdditionalNamespaces = new Vector<IElement>();
132: }
133: if (m_AdditionalNamespaces != null) {
134: IElement pElement = (IElement) pNamespace;
135: m_AdditionalNamespaces.add(pElement);
136: }
137: }
138: return 0;
139: }
140:
141: /**
142: * Should we create a scoped diagram?
143: *
144: * @param pVal[out]
145: *
146: * @return HRESULT
147: */
148: public boolean getCreateScopedDiagram() {
149: return m_CreateScopedDiagram;
150: }
151:
152: /**
153: * Should we create a scoped diagram?
154: *
155: * @param pVal[out]
156: *
157: * @return HRESULT
158: */
159: public void setCreateScopedDiagram(boolean value) {
160: m_CreateScopedDiagram = value;
161: }
162:
163: /**
164: * The name of the scoped diagram.
165: *
166: * @param pVal[out]
167: *
168: * @return HRESULT
169: */
170: public String getScopedDiagramName() {
171: return m_ScopedDiagramName;
172: }
173:
174: /**
175: * The name of the scoped diagram.
176: *
177: * @param pVal[out]
178: *
179: * @return HRESULT
180: */
181: public void setScopedDiagramName(String value) {
182: m_ScopedDiagramName = value;
183: }
184:
185: /**
186: * The kind of scoped diagram.
187: *
188: * @param pKind[out]
189: *
190: * @return HRESULT
191: */
192: public int getScopedDiagramKind() {
193: return m_DiagramKind;
194: }
195:
196: /**
197: * The kind of scoped diagram.
198: *
199: * @param pKind[out]
200: *
201: * @return HRESULT
202: */
203: public void setScopedDiagramKind(int value) {
204: m_DiagramKind = value;
205: }
206:
207: /**
208: * The kind of package to create.
209: *
210: * @param pVal[out]
211: *
212: * @return HRESULT
213: */
214: public int getPackageKind() {
215: return m_PackageKind;
216: }
217:
218: /**
219: * The kind of package to create.
220: *
221: * @param pVal[out]
222: *
223: * @return HRESULT
224: */
225: public void setPackageKind(int value) {
226: m_PackageKind = value;
227: }
228:
229: /**
230: * Should the dialog show the From Reverse Engineering selection?
231: *
232: * @param pVal[out]
233: *
234: * @return HRESULT
235: */
236: public boolean getAllowFromRESelection() {
237: return m_AllowFromRESelection;
238: }
239:
240: /**
241: * Should the dialog show the From Reverse Engineering selection?
242: *
243: * @param pVal[out]
244: *
245: * @return HRESULT
246: */
247: public void setAllowFromRESelection(boolean value) {
248: m_AllowFromRESelection = value;
249: }
250:
251: }
|