Source Code Cross Referenced for IProjectTreeModel.java in  » IDE-Netbeans » uml » org » netbeans » modules » uml » ui » controls » projecttree » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » uml » org.netbeans.modules.uml.ui.controls.projecttree 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


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:        /*
043:         *
044:         * Created on Jun 2, 2003
045:         * @author Trey Spiva
046:         */
047:        package org.netbeans.modules.uml.ui.controls.projecttree;
048:
049:        import java.util.Comparator;
050:        import org.netbeans.modules.uml.ui.support.projecttreesupport.ITreeItem;
051:        import org.netbeans.modules.uml.core.metamodel.core.foundation.IElement;
052:        import org.netbeans.modules.uml.core.metamodel.structure.IProject;
053:        import org.netbeans.modules.uml.core.support.umlutils.ETList;
054:        import org.netbeans.modules.uml.core.workspacemanagement.IWorkspace;
055:
056:        /**
057:         * 
058:         * @author Trey Spiva
059:         */
060:        public interface IProjectTreeModel {
061:            /**
062:             * Adds a listener for the TreeModelEvent posted after the tree changes.
063:             * 
064:             * @param listener The lisener to add.
065:             */
066:            public void addProjectTreeModelListener(
067:                    IProjectTreeModelListener listener);
068:
069:            /**
070:             * Removes a listener previously added with <code>addProjectTreeModelListener</code>
071:             * 
072:             * @param listener The listener to remove.
073:             */
074:            public void removeProjectTreeModelListener(
075:                    IProjectTreeModelListener listener);
076:
077:            /**
078:             * Returns the child of parent at a given index in the parent's child  
079:             * array.  parent must be a node previously obtained from this data source.  
080:             * This  should not return null if index is a valid index for parent (that is 
081:             * index >= 0 && index < getChildCount(parent)). 
082:             * 
083:             * @param parent A ITreeItem in the tree, obtained from this data source 
084:             * @param index The child to retrieve.
085:             * @return
086:             */
087:            public ITreeItem getChildItem(Object parent, int index);
088:
089:            /**
090:             * Returns the number of children of parent. Returns 0 if the node is a leaf 
091:             * or if it has no children. parent must be a ITreeItem previously obtained 
092:             * from this data source. 
093:             * 
094:             * @param parent A ITreeItem in the tree, obtained from this data source 
095:             * @return
096:             */
097:            public int getChildCount(Object parent);
098:
099:            /**
100:             * Returns <code>true</code> if node is a leaf. It is possible for this 
101:             * method to return <code>false</code> even if node has no children. A 
102:             * directory in a filesystem, for example, may contain no files; the node 
103:             * representing the directory is not a leaf, but it also has no children. 
104:             * 
105:             * @param node A ITreeItem in the tree, obtained from this data source 
106:             * @return
107:             */
108:            public boolean isLeaf(Object node);
109:
110:            /**
111:             * Retrieves the workspace that the project tree is associated
112:             * with.
113:             * 
114:             * @return The workspace.
115:             */
116:            public IWorkspace getWorkspace();
117:
118:            /**
119:             * Retrieve the tree's root item.
120:             * 
121:             * @return The root item.
122:             */
123:            public ITreeItem getRootItem();
124:
125:            /**
126:             * Retrieve Diagrams root node
127:             * 
128:             * @return The Diagrams item.
129:             */
130:            public ITreeItem getDiagramsRootNode(IProject project);
131:
132:            /**
133:             * Check if the node is an instance of Diagrams root node
134:             * 
135:             * @return true if the  node is an instance of UMLDiagramRootNode; false otherwise.
136:             */
137:            public boolean isDiagramsRootNode(ITreeItem node);
138:
139:            public IProjectTreeItem addItem(IProjectTreeItem parent,
140:                    String name, String text, long sortPriority,
141:                    IElement element, Object supportTreeItem, String description);
142:
143:            public IProjectTreeItem addItem(ITreeItem parent, String name,
144:                    String text, long sortPriority, IElement element,
145:                    Object supportTreeItem, String description);
146:
147:            /**
148:             * Apends the node to the end of the parents child list.
149:             * 
150:             * @param parent The parent to recieve the new node.
151:             * @param node The node to be added.
152:             */
153:            public void addItem(ITreeItem parent, ITreeItem node);
154:
155:            /**
156:             * Inserts the new node into the parent child list at a specified location.
157:             * The notifyOfAddedChildren will be sent after the node is added.
158:             * 
159:             * @param parent The parent to recieve the new node.
160:             * @param node The node to be added.
161:             * @param index The index to insert the node.  If the index is greater than
162:             *              the number of children the node will be appended to the
163:             *              end of the child list.
164:             */
165:            //   public void insertItem(ITreeItem parent, ITreeItem node, int index);
166:
167:            /**
168:             * Remove all instances of the model element from the tree.
169:             * 
170:             * @param element The element to remove.
171:             */
172:            public void removeAll(IElement element);
173:
174:            /** 
175:             * Remove the specified node from its parent node.  All model listeners will
176:             * be notified of the change.
177:             * 
178:             * @param node The node to remove.
179:             */
180:            public void removeNodeFromParent(ITreeItem node);
181:
182:            /**
183:             * The IProject will be associated to the node that represents the IWSProject
184:             * element.
185:             * 
186:             * @param pProject The project that has been opened.
187:             * @return The ITreeItem that is the project node.
188:             */
189:            public ITreeItem projectOpened(IProject pProject);
190:
191:            /**
192:             * Clears the content of the model.  This basically a refresh.
193:             */
194:            public void clear();
195:
196:            /**
197:             * Retrieves the index of a child node.  
198:             * 
199:             * @param parent The parent of the child node.
200:             * @param child The child node to find.
201:             * @return The index value.  -1 if the second parameter is not a child of the 
202:             *         parent node.  The method <code>equals</code> is used to find the
203:             *         child node.
204:             */
205:            public int getIndexOfChild(ITreeItem parent, ITreeItem child);
206:
207:            /**
208:             * Sorts the children of a node.  The children will be sorted occuring to
209:             * the default sort order.
210:             * 
211:             * @param parent The parent who children are to be sorted.
212:             */
213:            public void sortChildren(ITreeItem parent);
214:
215:            /**
216:             * Sorts the children of a node.  The children will be sorted occuring to
217:             * the Comparable interface.
218:             * 
219:             * @param parent The parent who children are to be sorted.
220:             * @param compare The comparable interface used to sort the children.
221:             * @see Comparable
222:             */
223:            public void sortChildren(ITreeItem parent, Comparator compare);
224:
225:            /**
226:             * Locates the nodes that represents the model element.
227:             * 
228:             * @param element The model element to locate.
229:             * @return The tree Node.  <code>null</code> is returned if the node 
230:             *         is not found.
231:             */
232:            public ETList<ITreeItem> findNodes(IElement element);
233:
234:            /**
235:             * Locates the nodes that represents the diagram.
236:             * 
237:             * @param filename The name of the file that specifies the diagram.
238:             * @return The tree Nodes.  <code>null</code> is returned if the node 
239:             *         is not found.
240:             */
241:            public ETList<ITreeItem> findDiagramNodes(String filename);
242:
243:            /**
244:             * Locates the nodes that represents the model element.
245:             * 
246:             * @param element The model element to locate.
247:             * @return The tree Node.  <code>null</code> is returned if the node 
248:             *         is not found.
249:             */
250:            public ETList<ITreeItem> findNodes(Comparator<ITreeItem> comparator);
251:
252:            /**
253:             * Notifies all listeners that some of the nodes structure has changed.  
254:             * The mannor that the controls are notified is specific to the platform.
255:             * <br>
256:             * <b>Example:</b> For a Swing control the registered TreeModelListener will
257:             * recieve the treeStructureChanged event.
258:             * 
259:             * @parms items The tree items that has been changed. 
260:             */
261:            public void notifyOfStructureChange(ETList<ITreeItem> items);
262:
263:            /**
264:             * Notifies all listeners that a child was removed from its parent.  
265:             * The mannor that the controls are notified is specific to the platform.
266:             * <br>
267:             * <b>Example:</b> For a Swing control the registered TreeModelListener will
268:             * recieve the treeNodesRemoved event.
269:             * 
270:             * @parms parent The parent tree item that is affected.
271:             * @param childIndices The index of the child nodes that was removed.
272:             * @param children The children nodes that was removed.
273:             */
274:            public void notifyOfRemovedChildren(ITreeItem parent,
275:                    int[] childIndices, ITreeItem[] children);
276:
277:            /**
278:             * Notifies all listeners that a child was added to a parent.  
279:             * The mannor that the controls are notified is specific to the platform.
280:             * <br>
281:             * <b>Example:</b> For a Swing control the registered TreeModelListener will
282:             * recieve the treeNodesInserted event.
283:             * 
284:             * @parms parent The parent tree item that is affected.
285:             * @param childIndices The index of the child nodes that was added.
286:             * @param children The children nodes that was added.
287:             */
288:            public void notifyOfAddedChildren(ITreeItem parent,
289:                    int[] childIndices/*, 
290:                                                 ITreeItem[] children*/);
291:
292:            /**
293:             * Notifies all listeners that the content of some nodes has changed.  
294:             * The mannor that the controls are notified is specific to the platform.
295:             * <br>
296:             * <b>Example:</b> For a Swing control the registered TreeModelListener will
297:             * recieve the treeNodesChanged event.
298:             * 
299:             * @parms parent The parent tree item that is affected.
300:             * @param childIndices The index of the child nodes that was added.
301:             * @param children The children nodes that was added.
302:             */
303:            public void notifyOfNodesChanged(ITreeItem parent,
304:                    int[] childIndices, ITreeItem[] nodes);
305:
306:            /**
307:             * Test if it is OK to delete a tree item.
308:             * 
309:             * @param item The item to test.
310:             * @return <b>true</b> if it is OK to delete the tree item, <b>false</b> if 
311:             *         it is not OK to delete the tree item.
312:             */
313:            public boolean canDelete(IProjectTreeItem item);
314:
315:            /**
316:             * Test if it is OK to edit a tree item.
317:             * 
318:             * @param item The item to test.
319:             * @return <b>true</b> if it is OK to delete the tree item, <b>false</b> if 
320:             *         it is not OK to delete the tree item.
321:             */
322:            public boolean canEdit(IProjectTreeItem item);
323:
324:            /**
325:             * Retrieves the node factory to use when creating nodes for the model.
326:             * 
327:             * @return The factory to use.
328:             */
329:            public ProjectTreeNodeFactory getNodeFactory();
330:
331:            /**
332:             * Retreives the name of the model.
333:             */
334:            public String getModelName();
335:
336:            /**
337:             * Fires an event when a given tree node is expanded
338:             * 
339:             * @param item The item to be expanded.
340:             * 
341:             */
342:            public void fireItemExpanding(ITreeItem item);
343:
344:        }
ww__w_.___j_a__v___a_2s_.__c___o__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.