我正在使用eclipse e4,我想创建一个名为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));
}