是否可以将CSS样式应用于Eclipse中的对话框或向导模式窗口? [英] Is it possible to apply CSS styles to a dialogue or wizard modal window in Eclipse?

查看:29
本文介绍了是否可以将CSS样式应用于Eclipse中的对话框或向导模式窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将CSS样式应用于Eclipse中的对话框或向导模式窗口?我已经能够使用CSS Spy插件找出大多数元素,但是当我提出一个模式时,Spy变得不活动.

Is it possible to apply CSS styles to a dialogue or wizard modal window in Eclipse? I've been able to use the CSS Spy plug-in to figure out most elements but when I bring a modal up, Spy becomes inactive.

推荐答案

是的,您创建的对话框和向导是可能的.但是,更改对话框或向导的某些样式可能非常棘手(例如对话框背景).在某种程度上,您还可以将样式应用于现有对话框.

Yes it is possible for dialogs and wizards that you create. However changing some of the styles of a dialog or wizard can be quite tricky (such as the dialog background). To some extent you can also apply styles to existing dialogs.

对于创建的对话框,您可能需要为对话框区域设置CSS类,以使其更容易指定仅应用于对话框的样式:

For dialogs you create you probably want to set a CSS class for the dialog area to make it easier to specify styles applying just to the dialog:

@Override
protected Control createDialogArea(final Composite parent)
{
  Composite composite = new Composite(parent, SWT.NONE);

  composite.setBackgroundMode(SWT.INHERIT_DEFAULT);

  WidgetElement.setCSSClass(composite, "DialogClass");

  ...

这将设置CSS类和复合背景模式.

This sets the CSS class and the composite background mode.

您还可以使用以下形式的CSS选择器将样式应用于任何对话框:

You can also apply styles to any dialog using CSS selectors in the form:

Shell[style~='SWT.APPLICATION_MODAL'] > Composite > Text
{
    font-size: 14pt;  
}

将样式应用于应用程序模型对话框中的Text控件.

which applies the style to a Text control in a application model dialog.

具有样式的示例 Dialog :

这篇关于是否可以将CSS样式应用于Eclipse中的对话框或向导模式窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆