当前位置: 代码迷 >> Eclipse >> RCP 弹出新窗体解决方案
  详细解决方案

RCP 弹出新窗体解决方案

热度:23   发布时间:2016-04-23 13:35:21.0
RCP 弹出新窗体
RCP 点击某个按钮弹出新窗体如何实现?

------解决方案--------------------
Java code
public void run() {        if (workbenchWindow == null) {            // action has been disposed            return;        }        try {            String perspId;            IWorkbenchPage page = workbenchWindow.getActivePage();            if (page != null && page.getPerspective() != null) {                perspId = page.getPerspective().getId();            } else {                perspId = workbenchWindow.getWorkbench()                        .getPerspectiveRegistry().getDefaultPerspective();            }            workbenchWindow.getWorkbench().openWorkbenchWindow(perspId,                    pageInput);        } catch (WorkbenchException e) {                        StatusUtil.handleStatus(e.getStatus(),                    WorkbenchMessages.OpenInNewWindowAction_errorTitle                            + ": " + e.getMessage(), //$NON-NLS-1$                    StatusManager.SHOW);        }
------解决方案--------------------
参照RCP Mail Template
------解决方案--------------------
RCP 和swing一样也是用事件驱动模型。多看API就可以了
  相关解决方案