【问题标题】:Restart text colors configuration of own eclipse editor plugin重启自己的eclipse编辑器插件的文本颜色配置
【发布时间】:2014-08-01 22:38:39
【问题描述】:

我创建了一个新的 eclipse 编辑器插件并设置了这个页面和代码的颜色: http://www.realsolve.co.uk/site/tech/jface-text.php

public XMLEditor()
{
    super();
    colorManager = new ColorManager();
    setSourceViewerConfiguration(new XMLConfiguration(colorManager));
    setDocumentProvider(new XMLDocumentProvider());
}

现在,我创建了一个新的首选项页面来更改颜色。更改此页面中的颜色后,我为编辑器设置了一个新的 SourceViewerConfiguration,但颜色没有改变。

如果我关闭并重新打开编辑器,颜色会改变。 有人知道一些重置或重新启动编辑器的方法。或者一些更新 SourceViewerConfiguration 和颜色的方法?

【问题讨论】:

    标签: java eclipse plugins eclipse-plugin editor


    【解决方案1】:

    我使用此代码进行了管理,但它停止使用一些别名,例如“CTRL + Z”:

        configuration = new XMLConfiguration(colorManager);
        setSourceViewerConfiguration(configuration);
    
        ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
        try {
            viewer.configure(configuration);
        } catch (java.lang.IllegalStateException e) {
            // Empty
        }
    

    【讨论】:

      猜你喜欢
      • 2015-10-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-27
      相关资源
      最近更新 更多