Customizing Outline View [message #1011258] |
Tue, 19 February 2013 07:35 |
Ankit Agarwal Messages: 35 Registered: March 2012 |
Member |
|
|
Hi,
I have a file opened in Editor whose contents i want to show on my outline view, i dont want to show all the contents though.
My file looks like
import abcd.x
import abcde.x
String hello;
int a;
public int add(int a){
int c = 10;
return a+c;
}
}
Right now my outline view displays everything that is there inside the method add in a tree format. But i only want to show any variable defined in it (like int c).
My OutlineTreeProvider looks like :
Class MyOutlineTreeProvider extends DefaultOutlineTreeProvider {
protected void _createChildren(DocumentRootNode parentNode,Model modelElement) {
for (EObject element : modelElement.getImports()) {
createNode(parentNode, element);
}
for (EObject element : modelElement.getVardecls()) {
createNode(parentNode, element);
}
for (EObject element : modelElement.getMethods()) {
createNode(parentNode, element);
}
}
Now how do i eliminate other information from inside the Method in outline view.
I tried the method mentioned in http://www.eclipse.org/Xtext/documentation.html#outline, but could not get it working
[Updated on: Tue, 19 February 2013 07:42] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05161 seconds