Java 类org.eclipse.ui.IPerspectiveListener 实例源码

项目:watchdog    文件:WindowListener.java   
private void addPerspectiveListener(IWorkbenchWindow window) {
    IPerspectiveListener perspectiveListener = new PerspectiveListener();
    window.addPerspectiveListener(perspectiveListener);

    // triggers the event for the currently open perspective, if there is
    // any
    IWorkbenchPage activePage = window.getActivePage();
    if (activePage != null) {
        IPerspectiveDescriptor currentPerspective = window.getActivePage()
                .getPerspective();
        if (currentPerspective != null) {
            perspectiveListener.perspectiveActivated(activePage,
                    currentPerspective);
        }

    }
}
项目:tlaplus    文件:UIHelper.java   
/**
 * Attaches the perspective listener to active window
 * 
 * @param listener
 */
public static void addPerspectiveListener(IPerspectiveListener listener) {
    IWorkbench workbench = Activator.getDefault().getWorkbench();
    IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
    window.addPerspectiveListener(listener);
}
项目:eclipse-tapestry5-plugin    文件:NullWorkbenchWindow.java   
@Override public void removePerspectiveListener(IPerspectiveListener listener) { }
项目:eclipse-tapestry5-plugin    文件:NullWorkbenchWindow.java   
@Override public void addPerspectiveListener(IPerspectiveListener listener) { }