代码之家  ›  专栏  ›  技术社区  ›  Jay

使用EclipseRCP进行工作台应用程序开发:它有多丰富?

  •  1
  • Jay  · 技术社区  · 14 年前

    就像主题写的:

    它们能被构建成和下面的应用程序屏幕一样好吗?

    或者,让我们定义一下 being:支持圆形边框、渐变背景、富文本、真字体以及所有适用于现代富UI外观的东西。

    alt text
    (来源: mimblog.de )

    1 回复  |  直到 5 年前
        1
  •  1
  •   Glorfindel Doug L.    5 年前

    即将到来的 eclipse e4 将支持eclipse本身,或RCP应用程序,所有种类的皮肤 including gradient-based ones

    alt text
    (来源: toedter.com )


    latest 3.6 builds can make use of the CSS themeing support .

    .h2 {
        color: white;
        font-size: 20pt;
    }
    
    .container {
        background-color: gradient radial #575757 #101010 60%;
    }
    

    final Composite p = new Composite(parent, SWT.NONE);
    p.setData(CSS_CLASS_KEY, "container");
    p.setBackgroundMode(SWT.INHERIT_DEFAULT);
    p.setLayout(new GridLayout(2, false));
    
    Label l = new Label(p, SWT.NONE);
    l.setData(CSS_CLASS_KEY, "h2");
    l.setText("This is a headline");
    l.setLayoutData(new GridData(SWT.FILL, SWT.DEFAULT, false, false, 2, 1));
    
    engine.applyStyles(p, true); // Apply the CSS-Instructions of the current active theme
    

    最后一行将当前主题CSS信息应用于给定小部件下面的所有元素。

    在主题之间切换非常容易:

    engine.setTheme("org.eclipse.e4.demo.contacts.dark");
    

    这使得3.x ViewPart看起来像这样,带有径向黑色渐变:

    alt text

    或者一个明亮的:

    alt text