Editor to outline view linking [message #1783889] |
Tue, 20 March 2018 00:50  |
Eclipse User |
|
|
|
Hello,
I am facing problem in editor to outline node linking.
I have just created a sample model for the problem, i am facing.
Grammar:
grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals
generate myDsl "http://www.xtext.org/example/mydsl/MyDsl"
Model:
students+=Student*;
Student:
name=ID seatNumber=INT address=STRING subjects=STRING;
Outline has been customised to made entries as child of other node.
@SuppressWarnings("all")
public class MyDslOutlineTreeProvider extends DefaultOutlineTreeProvider {
@Override
public void _createChildren(DocumentRootNode parent, EObject modelElement) {
EObjectNode node = null;
if (modelElement instanceof Model) {
EList<Student> students = ((Model) modelElement).getStudents();
createOutlineNode(students, parent);
}
}
private void createOutlineNode(EList<Student> students, IOutlineNode node) {
IOutlineNode nodeLocal = null;
nodeLocal = node;
for (Student student : students) {
nodeLocal = (IOutlineNode) createEObjectNode(nodeLocal, student, labelProvider.getImage(student),
student.getName(), true);
}
}
}
when I click in outline node, it is finding correct node in editor.
But from editor only on selection of first node, it reflects in outline view.
For the second, third and so on, it is not.
I am not able to link to correct node from editor to outline view.
Need support in this regard.
Thanks in advance.
Regards,
Virag Purnam
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04834 seconds