Java 将TrimmedWindow作为应用程序模型
我正在使用Eclipse4,我想创建一个名为TrimmedWindow的应用程序模型,我可以将其用作自定义对话框,但我不希望用户在对话框打开时使用后台窗口(阻止事件)。有什么方法可以用e4做到这一点吗 [编辑]Java 将TrimmedWindow作为应用程序模型,java,eclipse,modal-dialog,eclipse-rcp,e4,Java,Eclipse,Modal Dialog,Eclipse Rcp,E4,我正在使用Eclipse4,我想创建一个名为TrimmedWindow的应用程序模型,我可以将其用作自定义对话框,但我不希望用户在对话框打开时使用后台窗口(阻止事件)。有什么方法可以用e4做到这一点吗 [编辑] @Execute public void execute(MApplication application) { MTrimmedWindow mWindow = MBasicFactory.INSTANCE.createTrimmedWindow();
@Execute
public void execute(MApplication application) {
MTrimmedWindow mWindow = MBasicFactory.INSTANCE.createTrimmedWindow();
mWindow.setHeight(200);
mWindow.setWidth(400);
mWindow.getChildren().add(MBasicFactory.INSTANCE.createPart());
mWindow.setVisible(true);
mWindow.setOnTop(true);
application.getChildren().add(mWindow);
//how to set application model so that it blocks access to other background windows?
// SOLUTION
mWindow.getPersistedState().put(IPresentationEngine.STYLE_OVERRIDE_KEY, String.valueOf(SWT.APPLICATION_MODAL));
}
您可以使用@greg-449 Thank听起来很有趣,您知道我应该为该值输入什么吗?@greg-449 ok发现它非常简单,您只需插入
System.out.println(SWT.APPLICATION\u MODAL)的值
将您打印到控制台:)您可以使用@greg-449,谢谢听起来很有趣。您知道我应该为值输入什么吗?@greg-449知道了,很简单,您只需插入System.out.println(SWT.APPLICATION\u MODAL)的值即可。
将您打印到控制台:)