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.core.support.umlutils;
043:
044: public interface IPropertyElementManager {
045: /**
046: * Get the current presentation element
047: */
048: public Object getPresentationElement();
049:
050: /**
051: * Get the current presentation element
052: */
053: public void setPresentationElement(Object value);
054:
055: /**
056: * Get the current model element
057: */
058: public Object getModelElement();
059:
060: /**
061: * Get the current model element
062: */
063: public void setModelElement(Object value);
064:
065: /**
066: * Based on the passed in definition, build the corresponding element
067: */
068: public IPropertyElement buildTopPropertyElement(
069: IPropertyDefinition propDef);
070:
071: /**
072: * Get the definition factory
073: */
074: public IPropertyDefinitionFactory getPDFactory();
075:
076: /**
077: * Get the definition factory
078: */
079: public void setPDFactory(IPropertyDefinitionFactory value);
080:
081: /**
082: * Determines whether or not sub elements should be created
083: */
084: public boolean getCreateSubs();
085:
086: /**
087: * Determines whether or not sub elements should be created
088: */
089: public void setCreateSubs(boolean value);
090:
091: /**
092: * Performs an invoke on the passed in IDispatch to set its proper information based on the values in the element
093: */
094: public void setData(Object pDisp, IPropertyDefinition pDef,
095: IPropertyElement pEle);
096:
097: /**
098: * Performs an invoke on the passed in IDispatch to create the proper information based on the element
099: */
100: public Object createData(Object pDisp, IPropertyDefinition pDef,
101: IPropertyElement pEle);
102:
103: /**
104: * Performs an invoke on the model element stored on the pDeleteEle to delete the proper information
105: */
106: public void deleteData(IPropertyElement pDeleteEle,
107: IPropertyElement pEle);
108:
109: /**
110: * Take the information from the IDispatch and the definition and set the information on a new element
111: */
112: public IPropertyElement buildElement(Object pDisp,
113: IPropertyDefinition pDef, IPropertyElement pEle);
114:
115: /**
116: * Pass through method that determines based on the IDispatch and definition whether to create, set, or delete data
117: */
118: public long processData(Object pDisp, IPropertyDefinition pDef,
119: IPropertyElement pEle);
120:
121: /**
122: * Rebuild and refresh the data stored on the element and its necessary subelements
123: */
124: public long reloadElement(Object pDisp, IPropertyDefinition pDef,
125: IPropertyElement pEle);
126:
127: /**
128: * Rebuild and refresh the data stored on the element, but not its subelements
129: */
130: public long reloadElementWithDummy(Object pDisp,
131: IPropertyDefinition pDef, IPropertyElement pEle);
132:
133: /**
134: * Gets the xml file that defines the property elements
135: */
136: public String getElementFile();
137:
138: /**
139: * Gets the xml file that defines the property elements
140: */
141: public void setElementFile(String value);
142:
143: /**
144: * Based on the already set element file, build all elements for the passed in definition that are in the file
145: */
146: public IPropertyElement[] buildElementsUsingXMLFile(
147: IPropertyDefinition pDef);
148:
149: /**
150: * Based on its related definition, the value stored in the element may need to be tweeked for display purposes
151: */
152: public void interpretElementValue(IPropertyElement pEle);
153:
154: /**
155: * Performs an invoke on the passed in IDispatch to insert the proper information based on the element
156: */
157: public void insertData(Object pDisp, IPropertyDefinition pDef,
158: IPropertyElement pEle);
159:
160: /**
161: * Builds and returns an empty element structure based on the passed in definition
162: */
163: public IPropertyElementXML buildEmptyElementXML(
164: IPropertyDefinition pDef);
165:
166: /**
167: * Saves property elements to an xml file
168: */
169: public void saveElementsToXMLFile(String file, String dtdFile,
170: IPropertyElement[] pEles);
171:
172: /**
173: * Translates the element's data from an enumerated value into a string.
174: */
175: public void processEnumeration(IPropertyElement pEle);
176:
177: public Object interpretGetObjectDefinition(IPropertyElement pEle);
178:
179: }
|