Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 11257 Details for
Bug 60039
[ViewMgmt] (regression) IWorkbenchPage#findView returns non-null value after part has been closed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updated workbench patch with IPerspectiveListener2 as API
workbenchPatch.txt (text/plain), 7.27 KB, created by
Nick Edgar
on 2004-05-27 22:40:46 EDT
(
hide
)
Description:
Updated workbench patch with IPerspectiveListener2 as API
Filename:
MIME Type:
Creator:
Nick Edgar
Created:
2004-05-27 22:40:46 EDT
Size:
7.27 KB
patch
obsolete
>Index: Eclipse UI/org/eclipse/ui/internal/PerspectiveListenerListOld.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveListenerListOld.java,v >retrieving revision 1.4 >diff -u -r1.4 PerspectiveListenerListOld.java >--- Eclipse UI/org/eclipse/ui/internal/PerspectiveListenerListOld.java 27 Apr 2004 20:15:23 -0000 1.4 >+++ Eclipse UI/org/eclipse/ui/internal/PerspectiveListenerListOld.java 28 May 2004 02:22:49 -0000 >@@ -61,6 +61,23 @@ > } > } > /** >+ * Notifies the listener that a part has been affected >+ * in the given perspective. >+ */ >+public void firePerspectiveChanged(final IWorkbenchPage page, final IPerspectiveDescriptor perspective, final IWorkbenchPartReference partRef, final String changeId) { >+ Object [] array = listeners.getListeners(); >+ for (int nX = 0; nX < array.length; nX ++) { >+ if (array[nX] instanceof IPerspectiveListener2) { >+ final IPerspectiveListener2 l2 = (IPerspectiveListener2) array[nX]; >+ Platform.run(new SafeRunnable() { >+ public void run() { >+ l2.perspectiveChanged(page, perspective, partRef, changeId); >+ } >+ }); >+ } >+ } >+} >+/** > * Removes an IPerspectiveListener from the perspective service. > */ > public void removePerspectiveListener(IPerspectiveListener l) { >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java,v >retrieving revision 1.148 >diff -u -r1.148 WorkbenchPage.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java 19 May 2004 21:22:31 -0000 1.148 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java 28 May 2004 02:22:59 -0000 >@@ -503,6 +503,11 @@ > this, > getPerspective(), > CHANGE_FAST_VIEW_ADD); >+ window.firePerspectiveChanged( >+ this, >+ getPerspective(), >+ ref, >+ CHANGE_FAST_VIEW_ADD); > } > /** > * Adds an IPartListener to the part service. >@@ -764,6 +769,11 @@ > this, > getPerspective(), > CHANGE_VIEW_SHOW); >+ window.firePerspectiveChanged( >+ this, >+ getPerspective(), >+ getReference(view), >+ CHANGE_VIEW_SHOW); > // Just in case view was fast. > window.updateFastViewBar(); > } >@@ -906,6 +916,11 @@ > getEditorManager().closeEditor(ref); > activationList.remove(ref); > firePartClosed(ref); >+ window.firePerspectiveChanged( >+ this, >+ getPerspective(), >+ ref, >+ CHANGE_EDITOR_CLOSE); > disposePart(ref); > } > >@@ -965,13 +980,17 @@ > // Close the part. > getEditorManager().closeEditor(ref); > firePartClosed(ref); >+ window.firePerspectiveChanged( >+ this, >+ getPerspective(), >+ ref, >+ CHANGE_EDITOR_CLOSE); > disposePart(ref); > // Notify interested listeners > window.firePerspectiveChanged( > this, > getPerspective(), > CHANGE_EDITOR_CLOSE); >- > // Activate new part. > if (partWasActive) { > IWorkbenchPart top = activationList.getTopEditor(); >@@ -1809,6 +1828,9 @@ > // Hide the part. > persp.hideView(ref); > >+ // Notify interested listeners >+ window.firePerspectiveChanged(this, getPerspective(), ref, CHANGE_VIEW_HIDE); >+ > // If the part is no longer reference then dispose it. > boolean exists = viewFactory.hasView(ref); > if (!exists) { >@@ -2199,6 +2221,11 @@ > this, > getPerspective(), > CHANGE_EDITOR_OPEN); >+ window.firePerspectiveChanged( >+ this, >+ getPerspective(), >+ ref, >+ CHANGE_EDITOR_OPEN); > } > > // getClientComposite().setRedraw(true); >@@ -2253,6 +2280,11 @@ > this, > getPerspective(), > CHANGE_FAST_VIEW_REMOVE); >+ window.firePerspectiveChanged( >+ this, >+ getPerspective(), >+ ref, >+ CHANGE_FAST_VIEW_REMOVE); > } > /** > * Removes an IPartListener from the part service. >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java,v >retrieving revision 1.228 >diff -u -r1.228 WorkbenchWindow.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java 26 May 2004 16:12:14 -0000 1.228 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchWindow.java 28 May 2004 02:23:05 -0000 >@@ -67,6 +67,7 @@ > import org.eclipse.ui.IWorkbenchActionConstants; > import org.eclipse.ui.IWorkbenchPage; > import org.eclipse.ui.IWorkbenchPart; >+import org.eclipse.ui.IWorkbenchPartReference; > import org.eclipse.ui.IWorkbenchWindow; > import org.eclipse.ui.PlatformUI; > import org.eclipse.ui.WorkbenchException; >@@ -800,6 +801,16 @@ > String changeId) { > perspectiveListeners.firePerspectiveChanged(page, perspective, changeId); > perspectiveService.firePerspectiveChanged(page, perspective, changeId); >+ } >+ /** >+ * Fires perspective changed for an affected part >+ */ >+ void firePerspectiveChanged( >+ IWorkbenchPage page, >+ IPerspectiveDescriptor perspective, >+ IWorkbenchPartReference partRef, >+ String changeId) { >+ perspectiveListeners.firePerspectiveChanged(page, perspective, partRef, changeId); > } > /** > * Fires perspective closed >Index: Eclipse UI/org/eclipse/ui/IPerspectiveListener2.java >=================================================================== >RCS file: Eclipse UI/org/eclipse/ui/IPerspectiveListener2.java >diff -N Eclipse UI/org/eclipse/ui/IPerspectiveListener2.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI/org/eclipse/ui/IPerspectiveListener2.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,38 @@ >+/******************************************************************************* >+ * Copyright (c) 2004 IBM Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Common Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/cpl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.ui; >+ >+/** >+ * Extension interface to <code>IPerspectiveListener</code> which >+ * adds support for listening to part-specific perspective lifecycle events. >+ * For example, this allows a perspective listener to determine which view >+ * is being hidden during a <code>CHANGE_VIEW_HIDE</code> event. >+ * <p> >+ * This interface may be implemented by clients. >+ * </p> >+ * >+ * @see IPageService#addPerspectiveListener >+ * >+ * @since 3.0 >+ */ >+public interface IPerspectiveListener2 extends IPerspectiveListener { >+ >+/** >+ * Notifies this listener that a part in the given page's perspective >+ * has changed in some way (for example, view show/hide, editor open/close, etc). >+ * >+ * @param page the workbench page containing the perspective >+ * @param perspective the descriptor for the changed perspective >+ * @param partRef the reference to the affected part >+ * @param changeId one of the <code>CHANGE_*</code> constants on IWorkbenchPage >+ */ >+public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId); >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 60039
:
11180
|
11181
| 11257