有许多小工具的编辑表现糟糕

问题描述 投票:0回答:2

我们切换到了e4目标平台。一位编辑在渲染时变得非常慢(大约20秒的布局)。当从编辑器菜单打开模态对话框时,应用程序会像癫痫症一样闪烁。

当我们关闭css时,...

DefaultScope.INSTANCE.getNode("org.eclipse.e4.ui.workbench.renderers.swt")
    .put("themeEnabled", "false");

在插件中,渲染速度非常快(<10ms),就像以前的目标平台一样。

这是我嵌入编辑器的控件(出于评估原因):

package xyz;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;

public class BigControl extends Composite {

    public BigControl(Composite parent, int style) {
        super(parent, style);
        setLayout(new GridLayout(23, false));
        for (int i=0; i<100; i++) {
            for (int j=0; j<23; j++) {
                new Label(this, SWT.NONE).setText("|" +  Integer.toString(i) + " " + Integer.toString(j) + "|");;
            }
        }
    }
}

有没有人遇到过这个问题?是的,我们知道表格对于这样的数据量会更好,但是重构这样做会花费太多。

第二个问题是,当我们关闭主题功能时,eclipse / swt在切换透视图,视图等时会产生异常。

themes e4
2个回答
0
投票

...为了清楚起见,我通过eclipse向导创建了一个全新的应用程序(...有视图)。

我替换了示例视图代码 - 正如我所提到的,当我们关闭css / theming(参见上面的代码)时,一切都很好 - 否则它不会停止动摇,甚至很难让鼠标指针回到eclipse停止应用程序:

package xyz;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.part.ViewPart;

public class View extends ViewPart {
    public static final String ID = "xyz.view";

    public class BigControl extends Composite {

        public BigControl(Composite parent, int style) {
            super(parent, style);
            setLayout(new GridLayout(23, false));
            for (int i=0; i<100; i++) {
                for (int j=0; j<23; j++) {
                    new Label(this, SWT.NONE).setText("|" + Integer.toString(i) +     " " + Integer.toString(j) + "|");;
            }
            }
        }
    }

    @Override
    public void createPartControl(Composite parent) {
        new BigControl(parent, SWT.NONE);
    }


    @Override
    public void setFocus() {
    }
}

0
投票

好的,我们用更新的目标平台(2019-3)替换了目标平台。我不知道使用旧平台。

闪烁停止,它仍然不快(调整窗口大约2秒),但目前是可以接受的。

谢谢您的帮助,

最好,马丁

© www.soinside.com 2019 - 2024. All rights reserved.