Line 0
Link Here
|
|
|
1 |
package org.netbeans.modules.uml.project.ui.nodes; |
2 |
|
3 |
import java.util.ArrayList; |
4 |
import java.util.Collection; |
5 |
import java.util.Iterator; |
6 |
import java.util.List; |
7 |
import java.util.ListIterator; |
8 |
import org.netbeans.modules.uml.core.metamodel.core.foundation.IElement; |
9 |
import org.netbeans.modules.uml.core.metamodel.core.foundation.INamespace; |
10 |
import org.netbeans.modules.uml.core.metamodel.diagrams.DiagramDetails; |
11 |
import org.netbeans.modules.uml.core.metamodel.diagrams.IDiagram; |
12 |
import org.netbeans.modules.uml.core.metamodel.diagrams.IProxyDiagram; |
13 |
import org.netbeans.modules.uml.core.metamodel.structure.IProject; |
14 |
import org.netbeans.modules.uml.core.support.umlutils.ETList; |
15 |
import org.openide.nodes.ChildFactory; |
16 |
import org.openide.nodes.Node; |
17 |
|
18 |
/** |
19 |
* |
20 |
* @author Javier A. Ortiz Bultrón <javier.ortiz.78@gmail.com> |
21 |
*/ |
22 |
public class UMLDiagramChildFactory extends ChildFactory<IProxyDiagram>{ |
23 |
|
24 |
@Override |
25 |
protected boolean createKeys(List<IProxyDiagram> toPopulate) { |
26 |
ArrayList<IProxyDiagram> nodes=new ArrayList<IProxyDiagram>(); |
27 |
nodes.add(new IProxyDiagram() { |
28 |
|
29 |
@Override |
30 |
public DiagramDetails getDiagramDetails() { |
31 |
return null; |
32 |
} |
33 |
|
34 |
@Override |
35 |
public String getName() { |
36 |
return "test"; |
37 |
} |
38 |
|
39 |
@Override |
40 |
public void setName(String value) { |
41 |
throw new UnsupportedOperationException("Not supported yet."); |
42 |
} |
43 |
|
44 |
@Override |
45 |
public String getAlias() { |
46 |
return "test"; |
47 |
} |
48 |
|
49 |
@Override |
50 |
public void setAlias(String value) { |
51 |
throw new UnsupportedOperationException("Not supported yet."); |
52 |
} |
53 |
|
54 |
@Override |
55 |
public String getNameWithAlias() { |
56 |
return "test"; |
57 |
} |
58 |
|
59 |
@Override |
60 |
public void setNameWithAlias(String value) { |
61 |
throw new UnsupportedOperationException("Not supported yet."); |
62 |
} |
63 |
|
64 |
@Override |
65 |
public String getQualifiedName() { |
66 |
return "test"; |
67 |
} |
68 |
|
69 |
@Override |
70 |
public String getDocumentation() { |
71 |
return "test"; |
72 |
} |
73 |
|
74 |
@Override |
75 |
public void setDocumentation(String value) { |
76 |
throw new UnsupportedOperationException("Not supported yet."); |
77 |
} |
78 |
|
79 |
@Override |
80 |
public INamespace getNamespace() { |
81 |
throw new UnsupportedOperationException("Not supported yet."); |
82 |
} |
83 |
|
84 |
@Override |
85 |
public void setNamespace(INamespace value) { |
86 |
throw new UnsupportedOperationException("Not supported yet."); |
87 |
} |
88 |
|
89 |
@Override |
90 |
public String getNamespaceXMIID() { |
91 |
return "test"; |
92 |
} |
93 |
|
94 |
@Override |
95 |
public String getXMIID() { |
96 |
return "test"; |
97 |
} |
98 |
|
99 |
@Override |
100 |
public String getFilename() { |
101 |
return "test"; |
102 |
} |
103 |
|
104 |
@Override |
105 |
public void setFilename(String value) { |
106 |
throw new UnsupportedOperationException("Not supported yet."); |
107 |
} |
108 |
|
109 |
@Override |
110 |
public int getDiagramKind() { |
111 |
return 1; |
112 |
} |
113 |
|
114 |
@Override |
115 |
public String getDiagramKindName() { |
116 |
return "test"; |
117 |
} |
118 |
|
119 |
@Override |
120 |
public IProject getProject() { |
121 |
throw new UnsupportedOperationException("Not supported yet."); |
122 |
} |
123 |
|
124 |
@Override |
125 |
public IDiagram getDiagram() { |
126 |
throw new UnsupportedOperationException("Not supported yet."); |
127 |
} |
128 |
|
129 |
@Override |
130 |
public boolean isOpen() { |
131 |
return true; |
132 |
} |
133 |
|
134 |
@Override |
135 |
public boolean isValidDiagram() { |
136 |
return true; |
137 |
} |
138 |
|
139 |
@Override |
140 |
public boolean isSame(IProxyDiagram pProxy) { |
141 |
return false; |
142 |
} |
143 |
|
144 |
@Override |
145 |
public boolean getReadOnly() { |
146 |
return false; |
147 |
} |
148 |
|
149 |
@Override |
150 |
public void addAssociatedDiagram(String sDiagramXMIID) { |
151 |
throw new UnsupportedOperationException("Not supported yet."); |
152 |
} |
153 |
|
154 |
@Override |
155 |
public void addAssociatedDiagram(IProxyDiagram pDiagram) { |
156 |
throw new UnsupportedOperationException("Not supported yet."); |
157 |
} |
158 |
|
159 |
@Override |
160 |
public void addDualAssociatedDiagrams(IProxyDiagram pDiagram1, IProxyDiagram pDiagram2) { |
161 |
throw new UnsupportedOperationException("Not supported yet."); |
162 |
} |
163 |
|
164 |
@Override |
165 |
public void removeAssociatedDiagram(String sDiagramXMIID) { |
166 |
throw new UnsupportedOperationException("Not supported yet."); |
167 |
} |
168 |
|
169 |
@Override |
170 |
public void removeAssociatedDiagram(IProxyDiagram pDiagram) { |
171 |
throw new UnsupportedOperationException("Not supported yet."); |
172 |
} |
173 |
|
174 |
@Override |
175 |
public void removeDualAssociatedDiagrams(IProxyDiagram pDiagram1, IProxyDiagram pDiagram2) { |
176 |
throw new UnsupportedOperationException("Not supported yet."); |
177 |
} |
178 |
|
179 |
@Override |
180 |
public ETList<IProxyDiagram> getAssociatedDiagrams() { |
181 |
throw new UnsupportedOperationException("Not supported yet."); |
182 |
} |
183 |
|
184 |
@Override |
185 |
public boolean isAssociatedDiagram(String sDiagramXMIID) { |
186 |
return false; |
187 |
} |
188 |
|
189 |
@Override |
190 |
public boolean isAssociatedDiagram(IProxyDiagram pDiagram) { |
191 |
return false; |
192 |
} |
193 |
|
194 |
@Override |
195 |
public void addAssociatedElement(String sTopLevelElementXMIID, String sModelElementXMIID) { |
196 |
throw new UnsupportedOperationException("Not supported yet."); |
197 |
} |
198 |
|
199 |
@Override |
200 |
public void addAssociatedElement(IElement pElement) { |
201 |
throw new UnsupportedOperationException("Not supported yet."); |
202 |
} |
203 |
|
204 |
@Override |
205 |
public void removeAssociatedElement(String sTopLevelElementXMIID, String sModelElementXMIID) { |
206 |
throw new UnsupportedOperationException("Not supported yet."); |
207 |
} |
208 |
|
209 |
@Override |
210 |
public void removeAssociatedElement(IElement pElement) { |
211 |
throw new UnsupportedOperationException("Not supported yet."); |
212 |
} |
213 |
|
214 |
@Override |
215 |
public ETList<IElement> getAssociatedElements() { |
216 |
return new ETList<IElement>() { |
217 |
|
218 |
@Override |
219 |
public boolean find(IElement obj) { |
220 |
throw new UnsupportedOperationException("Not supported yet."); |
221 |
} |
222 |
|
223 |
@Override |
224 |
public int getCount() { |
225 |
throw new UnsupportedOperationException("Not supported yet."); |
226 |
} |
227 |
|
228 |
@Override |
229 |
public IElement item(int i) { |
230 |
throw new UnsupportedOperationException("Not supported yet."); |
231 |
} |
232 |
|
233 |
@Override |
234 |
public void addIfNotInList(IElement element) { |
235 |
throw new UnsupportedOperationException("Not supported yet."); |
236 |
} |
237 |
|
238 |
@Override |
239 |
public boolean isInList(IElement element) { |
240 |
throw new UnsupportedOperationException("Not supported yet."); |
241 |
} |
242 |
|
243 |
@Override |
244 |
public void removeItem(IElement element) { |
245 |
throw new UnsupportedOperationException("Not supported yet."); |
246 |
} |
247 |
|
248 |
@Override |
249 |
public void removeThese(ETList<IElement> elements) { |
250 |
throw new UnsupportedOperationException("Not supported yet."); |
251 |
} |
252 |
|
253 |
@Override |
254 |
public void addThese(ETList<IElement> elements) { |
255 |
throw new UnsupportedOperationException("Not supported yet."); |
256 |
} |
257 |
|
258 |
@Override |
259 |
public void removeDuplicates() { |
260 |
throw new UnsupportedOperationException("Not supported yet."); |
261 |
} |
262 |
|
263 |
@Override |
264 |
public void clear() { |
265 |
throw new UnsupportedOperationException("Not supported yet."); |
266 |
} |
267 |
|
268 |
@Override |
269 |
public int size() { |
270 |
throw new UnsupportedOperationException("Not supported yet."); |
271 |
} |
272 |
|
273 |
@Override |
274 |
public boolean isEmpty() { |
275 |
throw new UnsupportedOperationException("Not supported yet."); |
276 |
} |
277 |
|
278 |
@Override |
279 |
public boolean contains(Object o) { |
280 |
throw new UnsupportedOperationException("Not supported yet."); |
281 |
} |
282 |
|
283 |
@Override |
284 |
public Iterator<IElement> iterator() { |
285 |
throw new UnsupportedOperationException("Not supported yet."); |
286 |
} |
287 |
|
288 |
@Override |
289 |
public Object[] toArray() { |
290 |
throw new UnsupportedOperationException("Not supported yet."); |
291 |
} |
292 |
|
293 |
@Override |
294 |
public <T> T[] toArray(T[] a) { |
295 |
throw new UnsupportedOperationException("Not supported yet."); |
296 |
} |
297 |
|
298 |
@Override |
299 |
public boolean add(IElement e) { |
300 |
throw new UnsupportedOperationException("Not supported yet."); |
301 |
} |
302 |
|
303 |
@Override |
304 |
public boolean remove(Object o) { |
305 |
throw new UnsupportedOperationException("Not supported yet."); |
306 |
} |
307 |
|
308 |
@Override |
309 |
public boolean containsAll(Collection<?> c) { |
310 |
throw new UnsupportedOperationException("Not supported yet."); |
311 |
} |
312 |
|
313 |
@Override |
314 |
public boolean addAll(Collection<? extends IElement> c) { |
315 |
throw new UnsupportedOperationException("Not supported yet."); |
316 |
} |
317 |
|
318 |
@Override |
319 |
public boolean addAll(int index, Collection<? extends IElement> c) { |
320 |
throw new UnsupportedOperationException("Not supported yet."); |
321 |
} |
322 |
|
323 |
@Override |
324 |
public boolean removeAll(Collection<?> c) { |
325 |
throw new UnsupportedOperationException("Not supported yet."); |
326 |
} |
327 |
|
328 |
@Override |
329 |
public boolean retainAll(Collection<?> c) { |
330 |
throw new UnsupportedOperationException("Not supported yet."); |
331 |
} |
332 |
|
333 |
@Override |
334 |
public IElement get(int index) { |
335 |
throw new UnsupportedOperationException("Not supported yet."); |
336 |
} |
337 |
|
338 |
@Override |
339 |
public IElement set(int index, IElement element) { |
340 |
throw new UnsupportedOperationException("Not supported yet."); |
341 |
} |
342 |
|
343 |
@Override |
344 |
public void add(int index, IElement element) { |
345 |
throw new UnsupportedOperationException("Not supported yet."); |
346 |
} |
347 |
|
348 |
@Override |
349 |
public IElement remove(int index) { |
350 |
throw new UnsupportedOperationException("Not supported yet."); |
351 |
} |
352 |
|
353 |
@Override |
354 |
public int indexOf(Object o) { |
355 |
throw new UnsupportedOperationException("Not supported yet."); |
356 |
} |
357 |
|
358 |
@Override |
359 |
public int lastIndexOf(Object o) { |
360 |
throw new UnsupportedOperationException("Not supported yet."); |
361 |
} |
362 |
|
363 |
@Override |
364 |
public ListIterator<IElement> listIterator() { |
365 |
throw new UnsupportedOperationException("Not supported yet."); |
366 |
} |
367 |
|
368 |
@Override |
369 |
public ListIterator<IElement> listIterator(int index) { |
370 |
throw new UnsupportedOperationException("Not supported yet."); |
371 |
} |
372 |
|
373 |
@Override |
374 |
public List<IElement> subList(int fromIndex, int toIndex) { |
375 |
throw new UnsupportedOperationException("Not supported yet."); |
376 |
} |
377 |
}; |
378 |
} |
379 |
|
380 |
@Override |
381 |
public boolean isAssociatedElement(String sModelElementXMIID) { |
382 |
return false; |
383 |
} |
384 |
|
385 |
@Override |
386 |
public boolean isAssociatedElement(IElement pElement) { |
387 |
return false; |
388 |
} |
389 |
}); |
390 |
toPopulate.addAll(nodes); |
391 |
return true; |
392 |
} |
393 |
|
394 |
@Override |
395 |
protected Node createNodeForKey(IProxyDiagram app) { |
396 |
return new UMLDiagramNode(app); |
397 |
} |
398 |
|
399 |
@Override |
400 |
protected Node[] createNodesForKey(IProxyDiagram key) { |
401 |
return new Node[]{createNodeForKey(key)}; |
402 |
} |
403 |
|
404 |
public void refresh() { |
405 |
refresh(true); |
406 |
} |
407 |
} |