-
Notifications
You must be signed in to change notification settings - Fork 16
Development Outline change
Fernando Dodino edited this page Apr 4, 2017
·
9 revisions
Outline view offers a hierarchical view of Wollok Objects.
If you want to change the default view (that is, all elements are displayed in a hierarchical tree) you can check WollokDslOutlineTreeProvider implementation in org.uqbar.project.wollok.ui.outline
package.
For example, if you want to show WSuite elements
- first, the variable declarations
- then, a fixture if it is present
- then methods & tests definitions no matter how it is defined in .xtext file, you can do
def _createChildren(IOutlineNode parentNode, WSuite it) {
#[members].children(parentNode)
parentNode.createEObjectNode(fixture)
#[tests].children(parentNode)
}
You can customize these properties of each outline element
- text
- image
This is achieved in WollokDslLabelProvider class in org.uqbar.project.wollok.ui.labeling
package, using dispatch methods. For example, if you want to customize the way Fixture elements appear, you define 2 dispatch methods:
def image(WFixture it) { 'fixture.png' }
/** fixture.png must be placed in *icons* folder of the same project */
def text(WFixture it) { 'fixture' }
You can also use variables and messages for a certain element:
def text(WNamedObject it) { name }
Please see Xtext Outline documentation