|
Lines 1-13
Link Here
|
| 1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
| 2 |
* Copyright (c) 2011,2014 Fabian Steeg. All rights reserved. This program and |
2 |
* Copyright (c) 2011, 2016 itemis AG and others. |
| 3 |
* the accompanying materials are made available under the terms of the Eclipse |
3 |
* |
| 4 |
* Public License v1.0 which accompanies this distribution, and is available at |
4 |
* All rights reserved. This program and the accompanying materials |
|
|
5 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 6 |
* which accompanies this distribution, and is available at |
| 5 |
* http://www.eclipse.org/legal/epl-v10.html |
7 |
* http://www.eclipse.org/legal/epl-v10.html |
| 6 |
* <p/> |
8 |
* |
| 7 |
* Contributors: |
9 |
* Contributors: |
| 8 |
* Fabian Steeg |
10 |
* Fabian Steeg - initial API and implementation (bug #277380) |
| 9 |
* - initial API and implementation; see bug 277380 |
11 |
* - custom outline labels, icons, and structure (bug #452650) |
| 10 |
* - custom outline labels, icons, and structure; see bug 452650 |
12 |
* Tamas Miklossy (itemis AG) - minor renamings (bug #493745) |
|
|
13 |
* |
| 11 |
*******************************************************************************/ |
14 |
*******************************************************************************/ |
| 12 |
package org.eclipse.gef4.dot.internal.parser.ui.outline; |
15 |
package org.eclipse.gef4.dot.internal.parser.ui.outline; |
| 13 |
|
16 |
|
|
Lines 28-34
Link Here
|
| 28 |
* Treat node statements as leafs if they have no attributes. |
31 |
* Treat node statements as leafs if they have no attributes. |
| 29 |
* |
32 |
* |
| 30 |
* @param node |
33 |
* @param node |
| 31 |
* The `NodeStmt` model element |
34 |
* The 'NodeStmt' model element |
| 32 |
* @return true if this node contains no attributes |
35 |
* @return true if this node contains no attributes |
| 33 |
*/ |
36 |
*/ |
| 34 |
protected boolean _isLeaf(NodeStmt node) { |
37 |
protected boolean _isLeaf(NodeStmt node) { |
|
Lines 36-45
Link Here
|
| 36 |
} |
39 |
} |
| 37 |
|
40 |
|
| 38 |
/** |
41 |
/** |
| 39 |
* `EdgeRhs` elements are displayed as leafs and not expandable. |
42 |
* 'EdgeRhs' elements are displayed as leafs and not expandable. |
| 40 |
* |
43 |
* |
| 41 |
* @param edge |
44 |
* @param edge |
| 42 |
* The `EdgeRhs` model element |
45 |
* The 'EdgeRhs' model element |
| 43 |
* @return true |
46 |
* @return true |
| 44 |
*/ |
47 |
*/ |
| 45 |
protected boolean _isLeaf(EdgeRhs edge) { |
48 |
protected boolean _isLeaf(EdgeRhs edge) { |
|
Lines 47-53
Link Here
|
| 47 |
} |
50 |
} |
| 48 |
|
51 |
|
| 49 |
/** |
52 |
/** |
| 50 |
* Skip the `AttrList` wrapper element in the outline structure. |
53 |
* Skip the 'AttrList' wrapper element in the outline structure. |
| 51 |
* |
54 |
* |
| 52 |
* @param parent |
55 |
* @param parent |
| 53 |
* The outline parent node. |
56 |
* The outline parent node. |
|
Lines 57-63
Link Here
|
| 57 |
protected void _createChildren(IOutlineNode parent, AttrStmt stmt) { |
60 |
protected void _createChildren(IOutlineNode parent, AttrStmt stmt) { |
| 58 |
if (stmt.getAttrLists().size() > 0) { |
61 |
if (stmt.getAttrLists().size() > 0) { |
| 59 |
EList<Attribute> attributes = stmt.getAttrLists().get(0) |
62 |
EList<Attribute> attributes = stmt.getAttrLists().get(0) |
| 60 |
.getAttributes(); // skip the `AttrList` |
63 |
.getAttributes(); // skip the 'AttrList' |
| 61 |
for (Attribute attribute : attributes) { |
64 |
for (Attribute attribute : attributes) { |
| 62 |
createNode(parent, attribute); |
65 |
createNode(parent, attribute); |
| 63 |
} |
66 |
} |