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 61000 Details for
Bug 174213
[ViewMgmt] add attribute to close a sticky view in all open perspectives
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Updated patch to resolve issues that Kim found.
174213_patch3.txt (text/plain), 10.21 KB, created by
Matthew Hatem
on 2007-03-15 15:08:33 EDT
(
hide
)
Description:
Updated patch to resolve issues that Kim found.
Filename:
MIME Type:
Creator:
Matthew Hatem
Created:
2007-03-15 15:08:33 EDT
Size:
10.21 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui >Index: src/org/eclipse/ui/internal/UIPreferenceInitializer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui/src/org/eclipse/ui/internal/UIPreferenceInitializer.java,v >retrieving revision 1.39 >diff -u -r1.39 UIPreferenceInitializer.java >--- src/org/eclipse/ui/internal/UIPreferenceInitializer.java 15 Mar 2007 18:29:53 -0000 1.39 >+++ src/org/eclipse/ui/internal/UIPreferenceInitializer.java 15 Mar 2007 19:05:54 -0000 >@@ -150,6 +150,9 @@ > > // By default the Fast View Bar allows to select a new fast view from the view list > node.putBoolean(IWorkbenchPreferenceConstants.DISABLE_NEW_FAST_VIEW, false); >+ >+ // Default the sticky view close behaviour to the old (3.2) style >+ node.putBoolean(IWorkbenchPreferenceConstants.ENABLE_STICKY_VIEW_CLOSE_IN_ALL, false); > > IEclipsePreferences rootNode = (IEclipsePreferences) Platform > .getPreferencesService().getRootNode() >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java,v >retrieving revision 1.50 >diff -u -r1.50 IWorkbenchPreferenceConstants.java >--- Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java 5 Feb 2007 04:33:22 -0000 1.50 >+++ Eclipse UI/org/eclipse/ui/IWorkbenchPreferenceConstants.java 15 Mar 2007 19:05:56 -0000 >@@ -451,4 +451,16 @@ > * @since 3.3 > */ > public static final String DISABLE_NEW_FAST_VIEW = "disableNewFastView"; //$NON-NLS-1$ >+ >+ /** >+ * A named preference for enabling an alternative behavior for closing sticky views. >+ * When enabled a sticky view is closed in all perspectives when the view is closed. >+ * <p> >+ * The default value for this preference is: <code>false</code>; use the 3.2 >+ * behaviour. >+ * </p> >+ * >+ * @since 3.3 >+ */ >+ public static final String ENABLE_STICKY_VIEW_CLOSE_IN_ALL = "ENABLE_STICKY_VIEW_CLOSE_IN_ALL"; //$NON-NLS-1$ > } >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java,v >retrieving revision 1.283 >diff -u -r1.283 WorkbenchPage.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java 14 Mar 2007 17:08:27 -0000 1.283 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java 15 Mar 2007 19:06:00 -0000 >@@ -2219,6 +2219,16 @@ > > // Notify interested listeners after the hide > window.firePerspectiveChanged(this, getPerspective(), CHANGE_VIEW_HIDE); >+ >+ // Clean the sticky list, if new sticky close behavior enabled >+ IPreferenceStore preferenceStore = PrefUtil.getAPIPreferenceStore(); >+ boolean closeAllStickyViews = preferenceStore.getBoolean(IWorkbenchPreferenceConstants.ENABLE_STICKY_VIEW_CLOSE_IN_ALL); >+ if (closeAllStickyViews) { >+ Set activatedStickyViewsInThisPerspective = (Set) stickyPerspectives.get(persp.getDesc().getId()); >+ if (activatedStickyViewsInThisPerspective != null) { >+ activatedStickyViewsInThisPerspective.remove(ref.getId()); >+ } >+ } > } > > /* package */void refreshActiveView() { >@@ -3386,12 +3396,15 @@ > window.updateActionSets(); > > if (newPersp != null && oldPersp != null) { >- Set activatedStickyViewsInThisPerspective = (Set) stickyPerspectives.get(newPersp.getDesc().getId()); >- if (activatedStickyViewsInThisPerspective == null) { >- activatedStickyViewsInThisPerspective = new HashSet(7); >- stickyPerspectives.put(newPersp.getDesc().getId(), activatedStickyViewsInThisPerspective); >- } >- >+ Set activatedStickyViewsInThisPerspective = (Set) stickyPerspectives.get(newPersp.getDesc().getId()); >+ if (activatedStickyViewsInThisPerspective == null) { >+ activatedStickyViewsInThisPerspective = new HashSet(7); >+ stickyPerspectives.put(newPersp.getDesc().getId(), activatedStickyViewsInThisPerspective); >+ } >+ >+ // See if we should close sticky views in all perspectives >+ IPreferenceStore preferenceStore = PrefUtil.getAPIPreferenceStore(); >+ boolean closeAllStickyViews = preferenceStore.getBoolean(IWorkbenchPreferenceConstants.ENABLE_STICKY_VIEW_CLOSE_IN_ALL); > IViewRegistry viewReg = WorkbenchPlugin.getDefault() > .getViewRegistry(); > IStickyViewDescriptor[] stickyDescs = viewReg.getStickyViews(); >@@ -3406,6 +3419,12 @@ > IWorkbenchPage.VIEW_CREATE); > activatedStickyViewsInThisPerspective.add(viewId); > } >+ // remove a view if it's sticky and its not visible in the old perspective >+ else if (closeAllStickyViews && newPersp.findView(viewId) != null >+ && oldPersp.findView(viewId) == null) { >+ hideView(newPersp.findView(viewId)); >+ activatedStickyViewsInThisPerspective.remove(viewId); >+ } > } catch (PartInitException e) { > WorkbenchPlugin > .log( >#P org.eclipse.ui.tests >Index: Eclipse UI Tests/org/eclipse/ui/tests/intro/IntroTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/intro/IntroTest.java,v >retrieving revision 1.12 >diff -u -r1.12 IntroTest.java >--- Eclipse UI Tests/org/eclipse/ui/tests/intro/IntroTest.java 8 May 2006 20:51:32 -0000 1.12 >+++ Eclipse UI Tests/org/eclipse/ui/tests/intro/IntroTest.java 15 Mar 2007 19:06:01 -0000 >@@ -10,16 +10,19 @@ > *******************************************************************************/ > package org.eclipse.ui.tests.intro; > >+import org.eclipse.jface.preference.IPreferenceStore; > import org.eclipse.ui.IPerspectiveDescriptor; > import org.eclipse.ui.IViewPart; > import org.eclipse.ui.IWorkbench; > import org.eclipse.ui.IWorkbenchPage; >+import org.eclipse.ui.IWorkbenchPreferenceConstants; > import org.eclipse.ui.IWorkbenchWindow; > import org.eclipse.ui.internal.Workbench; > import org.eclipse.ui.internal.WorkbenchPlugin; > import org.eclipse.ui.internal.WorkbenchWindow; > import org.eclipse.ui.internal.intro.IIntroConstants; > import org.eclipse.ui.internal.intro.IntroDescriptor; >+import org.eclipse.ui.internal.util.PrefUtil; > import org.eclipse.ui.intro.IIntroManager; > import org.eclipse.ui.intro.IIntroPart; > import org.eclipse.ui.tests.api.PerspectiveWithFastView; >@@ -115,6 +118,78 @@ > assertTrue(workbench.getIntroManager().closeIntro(part)); > assertNull(workbench.getIntroManager().getIntro()); > } >+ >+ /** >+ * Open the intro, change perspective, close the intro >+ * and ensure that the intro has not been closed in the >+ * other perspective. >+ * See bug 174213 >+ */ >+ public void testPerspectiveChangeWithCloseAllPrefFalse() { >+ IPreferenceStore preferenceStore = PrefUtil.getAPIPreferenceStore(); >+ preferenceStore.putValue(IWorkbenchPreferenceConstants.ENABLE_STICKY_VIEW_CLOSE_IN_ALL, "false"); >+ >+ IWorkbench workbench = window.getWorkbench(); >+ IIntroPart part = workbench.getIntroManager().showIntro(window, false); >+ assertNotNull(part); >+ IWorkbenchPage activePage = window.getActivePage(); >+ IPerspectiveDescriptor oldDesc = activePage.getPerspective(); >+ activePage.setPerspective(WorkbenchPlugin.getDefault() >+ .getPerspectiveRegistry().findPerspectiveWithId( >+ "org.eclipse.ui.tests.api.SessionPerspective")); >+ >+ IViewPart viewPart = window.getActivePage().findView( >+ IIntroConstants.INTRO_VIEW_ID); >+ assertNotNull(viewPart); >+ >+ window.getActivePage().hideView(viewPart); >+ viewPart = window.getActivePage().findView( >+ IIntroConstants.INTRO_VIEW_ID); >+ assertNull(viewPart); >+ >+ activePage.setPerspective(oldDesc); >+ viewPart = window.getActivePage().findView( >+ IIntroConstants.INTRO_VIEW_ID); >+ assertNotNull(viewPart); >+ >+ preferenceStore.putValue(IWorkbenchPreferenceConstants.ENABLE_STICKY_VIEW_CLOSE_IN_ALL, "false"); >+ } >+ >+ /** >+ * Open the intro, change perspective, close the intro >+ * and ensure that the intro has been closed in the >+ * other perspective. >+ * See bug 174213 >+ */ >+ public void testPerspectiveChangeWithCloseAllPrefTrue() { >+ IPreferenceStore preferenceStore = PrefUtil.getAPIPreferenceStore(); >+ preferenceStore.putValue(IWorkbenchPreferenceConstants.ENABLE_STICKY_VIEW_CLOSE_IN_ALL, "true"); >+ >+ IWorkbench workbench = window.getWorkbench(); >+ IIntroPart part = workbench.getIntroManager().showIntro(window, false); >+ assertNotNull(part); >+ IWorkbenchPage activePage = window.getActivePage(); >+ IPerspectiveDescriptor oldDesc = activePage.getPerspective(); >+ activePage.setPerspective(WorkbenchPlugin.getDefault() >+ .getPerspectiveRegistry().findPerspectiveWithId( >+ "org.eclipse.ui.tests.api.SessionPerspective")); >+ >+ IViewPart viewPart = window.getActivePage().findView( >+ IIntroConstants.INTRO_VIEW_ID); >+ assertNotNull(viewPart); >+ >+ window.getActivePage().hideView(viewPart); >+ viewPart = window.getActivePage().findView( >+ IIntroConstants.INTRO_VIEW_ID); >+ assertNull(viewPart); >+ >+ activePage.setPerspective(oldDesc); >+ viewPart = window.getActivePage().findView( >+ IIntroConstants.INTRO_VIEW_ID); >+ assertNull(viewPart); >+ >+ preferenceStore.putValue(IWorkbenchPreferenceConstants.ENABLE_STICKY_VIEW_CLOSE_IN_ALL, "false"); >+ } > > public void testPerspectiveReset() { > IWorkbench workbench = window.getWorkbench();
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 174213
:
60756
|
60944
|
61000
|
61085
|
61089
|
61168