Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/374.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 将TrimmedWindow作为应用程序模型_Java_Eclipse_Modal Dialog_Eclipse Rcp_E4 - Fatal编程技术网

Java 将TrimmedWindow作为应用程序模型

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();

我正在使用Eclipse4,我想创建一个名为TrimmedWindow的应用程序模型,我可以将其用作自定义对话框,但我不希望用户在对话框打开时使用后台窗口(阻止事件)。有什么方法可以用e4做到这一点吗

[编辑]

@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)的值即可。
将您打印到控制台:)