【问题标题】:Xtext customized OutlineXtext 定制大纲
【发布时间】:2014-11-21 01:02:24
【问题描述】:

我为基于 Xtext 的 DSL 定制了大纲,在大纲视图中创建了新节点和不同的层次结构。单击大纲节点时,与编辑器的交叉链接可以正常工作。然而,相反的情况并没有发生。我有两个要求: 1.当我在编辑器中单击语义元素时,如果按下“交叉链接”按钮,则应该选择大纲节点 2. 我想在继续编辑领域模型时保持树结构“全部展开”

任何指针都有帮助。

提前致谢

【问题讨论】:

    标签: xtext outline-view


    【解决方案1】:

    关于扩展

    包 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)
    

    也许您没有正确创建节点。但你必须自己找出解决方法

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-08-01
      • 2013-02-18
      • 2016-06-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多