/
EdeltaOutlineTreeProvider.xtend
46 lines (39 loc) · 1.21 KB
/
EdeltaOutlineTreeProvider.xtend
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* generated by Xtext 2.10.0
*/
package edelta.ui.outline
import com.google.inject.Inject
import edelta.edelta.EdeltaModifyEcoreOperation
import edelta.edelta.EdeltaOperation
import edelta.edelta.EdeltaProgram
import edelta.services.IEdeltaEcoreModelAssociations
import org.eclipse.xtext.ui.editor.outline.IOutlineNode
import org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider
/**
* Customization of the default outline structure.
*
* See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#outline
*/
class EdeltaOutlineTreeProvider extends DefaultOutlineTreeProvider {
@Inject extension IEdeltaEcoreModelAssociations
def protected void _createChildren(IOutlineNode parentNode, EdeltaProgram p) {
for (o : p.operations) {
createNode(parentNode, o)
}
for (o : p.modifyEcoreOperations) {
createNode(parentNode, o)
}
for (derived : p.eResource.copiedEPackages) {
// the cool thing is that we don't need to provide
// customization in the label provider for EPackage and EClass
// since Xtext defaults to the .edit plugin :)
createNode(parentNode, derived)
}
}
def _isLeaf(EdeltaOperation m) {
true
}
def _isLeaf(EdeltaModifyEcoreOperation m) {
true
}
}