Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/352.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 E4获取活动透视图ID或标签_Java_Perspective_E4 - Fatal编程技术网

Java E4获取活动透视图ID或标签

Java E4获取活动透视图ID或标签,java,perspective,e4,Java,Perspective,E4,我正在为透视图构建一个切换器。我想用一个按钮。因此,当我单击一次时,它将切换到透视图2;当我单击第二次时,它将切换回透视图1。我尝试了isOnTop,但它不起作用。请帮忙。多谢各位 public class SwitchPerspectiveHandler { @Execute public void execute(MApplication app, EPartService partService, EModelService modelService) { MPerspective

我正在为透视图构建一个切换器。我想用一个按钮。因此,当我单击一次时,它将切换到透视图2;当我单击第二次时,它将切换回透视图1。我尝试了isOnTop,但它不起作用。请帮忙。多谢各位

public class SwitchPerspectiveHandler {
@Execute
public void execute(MApplication app, EPartService partService, EModelService modelService) {
    MPerspective xxx = (MPerspective) modelService.find("xxx",   app);
    MPerspective yyy = (MPerspective) modelService.find("yyy", app);

    if (yyy.isOnTop()) {
        partService.switchPerspective(xxx);
    } else
        partService.switchPerspective(yyy);
}

}EModelService具有:

public MPerspective getActivePerspective(MWindow window);
您可以通过以下方式找到
mWindows

public MWindow getTopLevelWindowFor(MUIElement element);

其中
element
是窗口中的任何元素。

EModelService具有:

public MPerspective getActivePerspective(MWindow window);
您可以通过以下方式找到
mWindows

public MWindow getTopLevelWindowFor(MUIElement element);

其中
element
是窗口中的任何元素。

EModelService具有:

public MPerspective getActivePerspective(MWindow window);
您可以通过以下方式找到
mWindows

public MWindow getTopLevelWindowFor(MUIElement element);

其中
element
是窗口中的任何元素。

EModelService具有:

public MPerspective getActivePerspective(MWindow window);
您可以通过以下方式找到
mWindows

public MWindow getTopLevelWindowFor(MUIElement element);
其中
element
是窗口中的任意元素