我为基于Xtext的DSL定制了一个大纲,在Outline View中创建新节点和不同的层次结构。当您单击大纲节点时,与编辑器的交叉链接可以正常工作。然而,相反的情况并没有发生。我有两个要求: 1.当我在编辑器中单击一个语义元素时,如果按下了"cross-linked“按钮,则Outline Node应该是选中的。2.当我继续编辑域模型时,我希望保持树结构为"expand-all”
任何指针都是有帮助的。
提前感谢
发布于 2014-11-21 15:18:19
关于扩展
打包org.xtext.example.mydsl.ui;
import org.eclipse.xtext.ui.editor.outline.impl.OutlinePage;
public class MyOutlinePage extends OutlinePage {
    @Override
    protected int getDefaultExpansionLevel() {
        return Integer.MAX_VALUE;
    }
}
public class MyDslUiModule extends org.xtext.example.mydsl.ui.AbstractMyDslUiModule {
    public MyDslUiModule(AbstractUIPlugin plugin) {
        super(plugin);
    }
    public Class<? extends IContentOutlinePage> bindIContentOutlinePage() {
        return MyOutlinePage.class;
    }
}关于链接:
Debug org.eclipse.xtext.ui.editor.outline.actions.OutlineWithEditorLinker.selectInTreeView(ISelection)也许你没有正确地创建节点。但你也必须自己找出如何修复它
https://stackoverflow.com/questions/27052496
复制相似问题