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 86030 Details for
Bug 213645
[RCP] Requesting programmatic hook to create view folders that remain visible after their last child is closed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Updated patch
patch.txt (text/plain), 26.93 KB, created by
Carlos Devoto
on 2008-01-02 16:54:06 EST
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Carlos Devoto
Created:
2008-01-02 16:54:06 EST
Size:
26.93 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java,v >retrieving revision 1.44 >diff -u -r1.44 PerspectiveHelper.java >--- Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java 7 Dec 2007 19:00:44 -0000 1.44 >+++ Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java 2 Jan 2008 21:44:27 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Carlos Devoto carlos.devoto@compuware.com Bug 213645 > *******************************************************************************/ > > package org.eclipse.ui.internal; >@@ -766,9 +767,9 @@ > } > } > >- if (!hasChildren) { >+ if (!hasChildren && !(oldContainer instanceof ViewStack && ((ViewStack)oldContainer).getDurable())) { > // There are no more children in this container, so get rid of >- // it >+ // it (but only if the container is not a durable ViewStack) > if (oldContainer instanceof LayoutPart) { > LayoutPart parent = (LayoutPart) oldContainer; > ILayoutContainer parentContainer = parent.getContainer(); >@@ -1232,12 +1233,16 @@ > LayoutPart[] children = container.getChildren(); > if (children != null) { > boolean allInvisible = true; >- for (int i = 0, length = children.length; i < length; i++) { >- if (!(children[i] instanceof PartPlaceholder)) { >- allInvisible = false; >- break; >- } >- } >+ if (container instanceof ViewStack && !((ViewStack) container).isMinimized && ((ViewStack) container).getDurable()) { >+ allInvisible = false; >+ } else { >+ for (int i = 0, length = children.length; i < length; i++) { >+ if (!(children[i] instanceof PartPlaceholder)) { >+ allInvisible = false; >+ break; >+ } >+ } >+ } > if (allInvisible && (container instanceof LayoutPart)) { > // what type of window are we in? > LayoutPart cPart = (LayoutPart) container; >Index: Eclipse UI/org/eclipse/ui/internal/FastViewManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewManager.java,v >retrieving revision 1.21 >diff -u -r1.21 FastViewManager.java >--- Eclipse UI/org/eclipse/ui/internal/FastViewManager.java 15 May 2007 18:34:19 -0000 1.21 >+++ Eclipse UI/org/eclipse/ui/internal/FastViewManager.java 2 Jan 2008 21:44:27 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Carlos Devoto carlos.devoto@compuware.com Bug 213645 > ******************************************************************************/ > > package org.eclipse.ui.internal; >@@ -546,11 +547,21 @@ > //long startTick = System.currentTimeMillis(); > // Update the model first > List toMove = getTrueViewOrder(vs); >- for (Iterator viewIter = toMove.iterator(); viewIter.hasNext();) { >- IViewReference ref = (IViewReference) viewIter.next(); >- addViewReference(vs.getID(), -1, ref, false); >+ if (toMove.isEmpty()) { >+ // We are dealing with an empty durable ViewStack; hide it! >+ vs.dispose(); >+ ILayoutContainer parentContainer = vs.getContainer(); >+ ContainerPlaceholder placeholder = new ContainerPlaceholder(vs >+ .getID()); >+ placeholder.setRealContainer(vs); >+ parentContainer.replace(vs, placeholder); >+ >+ } else { >+ for (Iterator viewIter = toMove.iterator(); viewIter.hasNext();) { >+ IViewReference ref = (IViewReference) viewIter.next(); >+ addViewReference(vs.getID(), -1, ref, false); >+ } > } >- > vs.deferUpdates(false); > > // Find (or create) the trim stack to move to >@@ -558,9 +569,29 @@ > .calcStackSide(stackBounds), paneOrientation); > vstb.setRestoreOnUnzoom(restoreOnUnzoom); > vstb.setSelectedTabId(selId); >- updateTrim(vstb.getId()); >- >- //System.out.println("minimize time: " + (System.currentTimeMillis()-startTick)); //$NON-NLS-1$ >+ if (toMove.isEmpty()) { >+ // We are dealing with an empty durable ViewStack; show the trim! >+ IWindowTrim trim = vstb; >+ >+ // Ensure that the trim is displayed >+ if (!trim.getControl().getVisible()) { >+ tbm.setTrimVisible(trim, true); >+ } >+ >+ if (trim instanceof FastViewBar) { >+ FastViewBar fvb = (FastViewBar) trim; >+ fvb.update(true); >+ } else if (trim instanceof ViewStackTrimToolBar) { >+ vstb.update(true); >+ vstb.getControl().pack(); >+ LayoutUtil.resize(trim.getControl()); >+ } >+ tbm.forceLayout(); >+ } else { >+ updateTrim(vstb.getId()); >+ } >+ >+ //System.out.println("minimize time: " + (System.currentTimeMillis()-startTick)); //$NON-NLS-1$ > if (vstb != null) { > animation.addEndRect(vstb.getControl()); > scheduleDeferrableAnimation(); >@@ -593,6 +624,35 @@ > idParts[1] = null; > > List fvs = getFastViews(id); >+ if (fvs.isEmpty()) { >+ // We are dealing with a durable view stack that is currently empty, so execute special logic to restore it from the minimized state >+ LayoutPart part = perspective.getPresentation().findPart(id, null); >+ if (part instanceof ContainerPlaceholder) { >+ ContainerPlaceholder containerPlaceholder = (ContainerPlaceholder) part; >+ ILayoutContainer parentContainer = containerPlaceholder >+ .getContainer(); >+ ILayoutContainer container = (ILayoutContainer) containerPlaceholder >+ .getRealContainer(); >+ if (container instanceof LayoutPart) { >+ parentContainer.replace(containerPlaceholder, >+ (LayoutPart) container); >+ } >+ containerPlaceholder.setRealContainer(null); >+ IWindowTrim trim = tbm.getTrim(id); >+ >+ // If it's not there there's not much we can do >+ if (trim == null) >+ return; >+ >+ // Hide the trim >+ if (trim.getControl().getVisible()) { >+ tbm.setTrimVisible(trim, false); >+ tbm.forceLayout(); >+ } >+ } >+ return; >+ } >+ > for (Iterator fvIter = fvs.iterator(); fvIter.hasNext();) { > IViewReference ref = (IViewReference) fvIter.next(); > removeViewReference(ref, true, !fvIter.hasNext()); >Index: Eclipse UI/org/eclipse/ui/internal/PageLayout.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PageLayout.java,v >retrieving revision 1.57 >diff -u -r1.57 PageLayout.java >--- Eclipse UI/org/eclipse/ui/internal/PageLayout.java 2 May 2007 13:57:56 -0000 1.57 >+++ Eclipse UI/org/eclipse/ui/internal/PageLayout.java 2 Jan 2008 21:44:27 -0000 >@@ -14,6 +14,7 @@ > * Chris Gross <schtoo@schtoo.com> > * - Fix for 99155 - allow standalone view placeholders > * Chris Gross chris.gross@us.ibm.com Bug 107443 >+ * Carlos Devoto carlos.devoto@compuware.com Bug 213645 > *******************************************************************************/ > package org.eclipse.ui.internal; > >@@ -461,6 +462,17 @@ > } > > /* (non-Javadoc) >+ * @see org.eclipse.ui.IPageLayout#createDurableFolder(java.lang.String, int, float, java.lang.String) >+ */ >+ public IFolderLayout createDurableFolder(String folderId, int relationship, >+ float ratio, String refId) { >+ IFolderLayout folderLayout = createFolder(folderId, relationship, ratio, refId); >+ ViewStack folder = (ViewStack) getRefPart(folderId); >+ folder.setDurable(true); >+ return folderLayout; >+ } >+ >+ /* (non-Javadoc) > * @see org.eclipse.ui.IPageLayout#createPlaceholderFolder(java.lang.String, int, float, java.lang.String) > */ > public IPlaceholderFolderLayout createPlaceholderFolder(String folderId, >Index: Eclipse UI/org/eclipse/ui/internal/ViewStack.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewStack.java,v >retrieving revision 1.29 >diff -u -r1.29 ViewStack.java >--- Eclipse UI/org/eclipse/ui/internal/ViewStack.java 13 Sep 2007 12:35:13 -0000 1.29 >+++ Eclipse UI/org/eclipse/ui/internal/ViewStack.java 2 Jan 2008 21:44:27 -0000 >@@ -9,6 +9,7 @@ > * IBM Corporation - initial API and implementation > * Cagatay Kavukcuoglu <cagatayk@acm.org> > * - Fix for bug 10025 - Resizing views should not use height ratios >+ * Carlos Devoto carlos.devoto@compuware.com Bug 213645 > *******************************************************************************/ > package org.eclipse.ui.internal; > >@@ -49,6 +50,8 @@ > > private SystemMenuDetach detachViewAction; > >+ private boolean durable = false; >+ > public void addSystemActions(IMenuManager menuManager) { > appendToGroupIfPossible(menuManager, > "misc", new UpdatingActionContributionItem(fastViewAction)); //$NON-NLS-1$ >@@ -134,7 +137,12 @@ > if (Perspective.useNewMinMax(persp)) { > FastViewManager fvm = persp.getFastViewManager(); > if (minimized) { >+ // Need to temporarily set the durability attribute to false or we won't be able to minimized the folder >+ boolean tempDurable = durable; >+ durable = false; > fvm.moveToTrim(this, false); >+ // Restore the durability attribute to its previous value >+ durable = tempDurable; > } else { > // First, if we're maximized then revert > if (persp.getPresentation().getMaximizedStack() != null) { >@@ -199,4 +207,24 @@ > public StackPresentation getTestPresentation() { > return getPresentation(); > } >+ >+ /** >+ * Set the durability attribute for this stack. The stack's durability determines >+ * whether or not the stack remains visible after its last child is closed. >+ * >+ * @param durable If true, the stack remains visible after its last child is closed >+ */ >+ public void setDurable(boolean durable) { >+ this.durable = durable; >+ } >+ >+ /** >+ * Get the durability attribute for this stack. The stack's durability determines >+ * whether or not the stack remains visible after its last child is closed. >+ * >+ * @return true, if the stack remains visible when its last child is closed; false otherwise >+ */ >+ public boolean getDurable () { >+ return this.durable; >+ } > } >Index: Eclipse UI/org/eclipse/ui/IPageLayout.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IPageLayout.java,v >retrieving revision 1.33 >diff -u -r1.33 IPageLayout.java >--- Eclipse UI/org/eclipse/ui/IPageLayout.java 26 Jun 2007 17:35:10 -0000 1.33 >+++ Eclipse UI/org/eclipse/ui/IPageLayout.java 2 Jan 2008 21:44:27 -0000 >@@ -10,6 +10,7 @@ > * Chris Gross <schtoo@schtoo.com> > * - Fix for 99155 - allow standalone view placeholders > * Chris Gross chris.gross@us.ibm.com Bug 107443 >+ * Carlos Devoto carlos.devoto@compuware.com Bug 213645 > *******************************************************************************/ > package org.eclipse.ui; > >@@ -335,6 +336,31 @@ > float ratio, String refId); > > /** >+ * Creates and adds a new folder with the given id to this page layout. >+ * The position and relative size of the folder is expressed relative to >+ * a reference part. The folder created by this method will not disappear >+ * when its last child is closed. >+ * >+ * @param folderId the id for the new folder. This must be unique within >+ * the layout to avoid collision with other parts. >+ * @param relationship the position relative to the reference part; >+ * one of <code>TOP</code>, <code>BOTTOM</code>, <code>LEFT</code>, >+ * or <code>RIGHT</code> >+ * @param ratio a ratio specifying how to divide the space currently occupied by the reference part, >+ * in the range <code>0.05f</code> to <code>0.95f</code>. >+ * Values outside this range will be clipped to facilitate direct manipulation. >+ * For a vertical split, the part on top gets the specified ratio of the current space >+ * and the part on bottom gets the rest. >+ * Likewise, for a horizontal split, the part at left gets the specified ratio of the current space >+ * and the part at right gets the rest. >+ * @param refId the id of the reference part; either a view id, a folder id, >+ * or the special editor area id returned by <code>getEditorArea</code> >+ * @return the new folder >+ */ >+ public IFolderLayout createDurableFolder(String folderId, int relationship, >+ float ratio, String refId); >+ >+ /** > * Creates and adds a placeholder for a new folder with the given id to this page layout. > * The position and relative size of the folder is expressed relative to > * a reference part. >@@ -537,4 +563,5 @@ > * @since 3.3 > */ > public IPlaceholderFolderLayout getFolderForView(String id); >+ > } >#P org.eclipse.ui.tests.rcp >Index: Eclipse RCP Tests/org/eclipse/ui/tests/rcp/RcpTestSuite.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.tests.rcp/Eclipse RCP Tests/org/eclipse/ui/tests/rcp/RcpTestSuite.java,v >retrieving revision 1.8 >diff -u -r1.8 RcpTestSuite.java >--- Eclipse RCP Tests/org/eclipse/ui/tests/rcp/RcpTestSuite.java 8 May 2006 20:56:28 -0000 1.8 >+++ Eclipse RCP Tests/org/eclipse/ui/tests/rcp/RcpTestSuite.java 2 Jan 2008 21:44:28 -0000 >@@ -34,5 +34,6 @@ > addTest(new TestSuite(IWorkbenchPageTest.class)); > addTest(new TestSuite(WorkbenchSaveRestoreStateTest.class)); > addTest(new TestSuite(WorkbenchListenerTest.class)); >+ addTest(new TestSuite(CreateFolderTest.class)); > } > } >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.tests.rcp/plugin.xml,v >retrieving revision 1.6 >diff -u -r1.6 plugin.xml >--- plugin.xml 6 Apr 2005 19:22:31 -0000 1.6 >+++ plugin.xml 2 Jan 2008 21:44:28 -0000 >@@ -9,6 +9,16 @@ > class="org.eclipse.ui.tests.rcp.util.EmptyPerspective" > id="org.eclipse.ui.tests.rcp.util.EmptyPerspective"> > </perspective> >+ <perspective >+ class="org.eclipse.ui.tests.rcp.util.StandardFolderPerspective" >+ id="org.eclipse.ui.tests.rcp.util.StandardFolderPerspective" >+ name="Standard Folder Perspective"> >+ </perspective> >+ <perspective >+ class="org.eclipse.ui.tests.rcp.util.DurableFolderPerspective" >+ id="org.eclipse.ui.tests.rcp.util.DurableFolderPerspective" >+ name="Durable Folder Perspective"> >+ </perspective> > </extension> > <extension > point="org.eclipse.ui.views"> >Index: Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/StandardFolderPerspective.java >=================================================================== >RCS file: Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/StandardFolderPerspective.java >diff -N Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/StandardFolderPerspective.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/StandardFolderPerspective.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,54 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Compuware Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Compuware Corporation - initial implementation >+ *******************************************************************************/ >+package org.eclipse.ui.tests.rcp.util; >+ >+import org.eclipse.ui.IFolderLayout; >+import org.eclipse.ui.IPageLayout; >+import org.eclipse.ui.IPerspectiveFactory; >+ >+/** >+ * This perspective is used for testing the createFolder api. It defines an initial >+ * layout with an empty view folder. >+ */ >+public class StandardFolderPerspective implements IPerspectiveFactory { >+ >+ /** >+ * The perspective id for the empty perspective. >+ */ >+ public static final String PERSP_ID = "org.eclipse.ui.tests.rcp.util.StandardFolderPerspective"; //$NON-NLS-1$ >+ >+ /** >+ * Constructs a new Default layout engine. >+ */ >+ public StandardFolderPerspective() { >+ super(); >+ } >+ >+ /** >+ * Defines the initial layout for a perspective. >+ * >+ * Implementors of this method may add additional views to a >+ * perspective. The perspective already contains an editor folder >+ * with <code>ID = ILayoutFactory.ID_EDITORS</code>. Add additional views >+ * to the perspective in reference to the editor folder. >+ * >+ * This method is only called when a new perspective is created. If >+ * an old perspective is restored from a persistence file then >+ * this method is not called. >+ * >+ * @param factory the factory used to add views to the perspective >+ */ >+ public void createInitialLayout(IPageLayout layout) { >+ IFolderLayout folder = layout.createFolder("folder", IPageLayout.LEFT, 1.0f, layout.getEditorArea()); >+ folder.addPlaceholder(EmptyView.ID); >+ } >+ >+} >Index: Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/DurableFolderPerspective.java >=================================================================== >RCS file: Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/DurableFolderPerspective.java >diff -N Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/DurableFolderPerspective.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse RCP Tests/org/eclipse/ui/tests/rcp/util/DurableFolderPerspective.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,54 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Compuware Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Compuware Corporation - initial implementation >+ *******************************************************************************/ >+package org.eclipse.ui.tests.rcp.util; >+ >+import org.eclipse.ui.IFolderLayout; >+import org.eclipse.ui.IPageLayout; >+import org.eclipse.ui.IPerspectiveFactory; >+ >+/** >+ * This perspective is used for testing the createFolder api. It defines an initial >+ * layout with an empty view folder. >+ */ >+public class DurableFolderPerspective implements IPerspectiveFactory { >+ >+ /** >+ * The perspective id for the empty perspective. >+ */ >+ public static final String PERSP_ID = "org.eclipse.ui.tests.rcp.util.DurableFolderPerspective"; //$NON-NLS-1$ >+ >+ /** >+ * Constructs a new Default layout engine. >+ */ >+ public DurableFolderPerspective() { >+ super(); >+ } >+ >+ /** >+ * Defines the initial layout for a perspective. >+ * >+ * Implementors of this method may add additional views to a >+ * perspective. The perspective already contains an editor folder >+ * with <code>ID = ILayoutFactory.ID_EDITORS</code>. Add additional views >+ * to the perspective in reference to the editor folder. >+ * >+ * This method is only called when a new perspective is created. If >+ * an old perspective is restored from a persistence file then >+ * this method is not called. >+ * >+ * @param factory the factory used to add views to the perspective >+ */ >+ public void createInitialLayout(IPageLayout layout) { >+ IFolderLayout folder = layout.createDurableFolder("folder", IPageLayout.LEFT, 1.0f, layout.getEditorArea()); >+ folder.addPlaceholder(EmptyView.ID); >+ } >+ >+} >Index: Eclipse RCP Tests/org/eclipse/ui/tests/rcp/CreateFolderTest.java >=================================================================== >RCS file: Eclipse RCP Tests/org/eclipse/ui/tests/rcp/CreateFolderTest.java >diff -N Eclipse RCP Tests/org/eclipse/ui/tests/rcp/CreateFolderTest.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse RCP Tests/org/eclipse/ui/tests/rcp/CreateFolderTest.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,147 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 Compuware Corporation and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Compuware Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.ui.tests.rcp; >+ >+import junit.framework.TestCase; >+ >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.ui.IViewPart; >+import org.eclipse.ui.IWorkbenchPage; >+import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.PartInitException; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.application.IWorkbenchWindowConfigurer; >+import org.eclipse.ui.application.WorkbenchAdvisor; >+import org.eclipse.ui.internal.ContainerPlaceholder; >+import org.eclipse.ui.internal.LayoutPart; >+import org.eclipse.ui.internal.PartPane; >+import org.eclipse.ui.internal.ViewSite; >+import org.eclipse.ui.internal.ViewStack; >+import org.eclipse.ui.tests.rcp.util.DurableFolderPerspective; >+import org.eclipse.ui.tests.rcp.util.EmptyView; >+import org.eclipse.ui.tests.rcp.util.StandardFolderPerspective; >+import org.eclipse.ui.tests.rcp.util.WorkbenchAdvisorObserver; >+ >+/** >+ * Tests the behaviour of various IPageLayout.createFolder methods >+ */ >+public class CreateFolderTest extends TestCase { >+ >+ public CreateFolderTest(String name) { >+ super(name); >+ } >+ >+ private Display display = null; >+ >+ protected void setUp() throws Exception { >+ super.setUp(); >+ >+ assertNull(display); >+ display = PlatformUI.createDisplay(); >+ assertNotNull(display); >+ } >+ >+ protected void tearDown() throws Exception { >+ assertNotNull(display); >+ if (!display.isDisposed()) { >+ display.dispose(); >+ } >+ assertTrue(display.isDisposed()); >+ >+ super.tearDown(); >+ } >+ >+ /** >+ * Regression test standard folder creation in which the folder disappears after its last child is closed >+ */ >+ public void testCreateStandardFolder() { >+ WorkbenchAdvisor wa = new WorkbenchAdvisorObserver(1) { >+ >+ public void preWindowOpen(IWorkbenchWindowConfigurer configurer) { >+ super.preWindowOpen(configurer); >+ configurer.setShowPerspectiveBar(false); >+ } >+ >+ public void postStartup() { >+ try { >+ IWorkbenchWindow window = getWorkbenchConfigurer() >+ .getWorkbench().getActiveWorkbenchWindow(); >+ IWorkbenchPage page = window.getActivePage(); >+ IViewPart view = page.showView(EmptyView.ID); >+ PartPane pane = ((ViewSite) view.getSite()).getPane(); >+ ViewStack parent = ((ViewStack) (pane.getContainer())); >+ assertTrue(parent.getVisible()); >+ page.hideView(view); >+ assertFalse(parent.getVisible()); >+ } catch (PartInitException e) { >+ fail(e.toString()); >+ } >+ } >+ >+ public String getInitialWindowPerspectiveId() { >+ return StandardFolderPerspective.PERSP_ID; >+ } >+ }; >+ int code = PlatformUI.createAndRunWorkbench(display, wa); >+ assertEquals(PlatformUI.RETURN_OK, code); >+ } >+ >+ /** >+ * Regression test durable folder creation in which the folder remains visible after its last child is closed >+ */ >+ public void testCreateDurableFolder() { >+ WorkbenchAdvisor wa = new WorkbenchAdvisorObserver(1) { >+ >+ public void preWindowOpen(IWorkbenchWindowConfigurer configurer) { >+ super.preWindowOpen(configurer); >+ configurer.setShowPerspectiveBar(false); >+ } >+ >+ public void postStartup() { >+ try { >+ IWorkbenchWindow window = getWorkbenchConfigurer() >+ .getWorkbench().getActiveWorkbenchWindow(); >+ IWorkbenchPage page = window.getActivePage(); >+ IViewPart view = page.showView(EmptyView.ID); >+ PartPane pane = ((ViewSite) view.getSite()).getPane(); >+ ViewStack parent = ((ViewStack) (pane.getContainer())); >+ //confirm that the view stack is currently visible while it has one child >+ assertTrue(parent.getVisible()); >+ >+ //confirm that the view stack remains visible after its last child is closed >+ page.hideView(view); >+ assertTrue(parent.getVisible()); >+ >+ //confirm that the view stack can still be minimized >+ parent.setMinimized(true); >+ LayoutPart part = pane.getPage().getActivePerspective().getPresentation().findPart("folder", null); >+ assertTrue(part instanceof ContainerPlaceholder); >+ >+ //confirm that the view stack can be restored after it has been minimized >+ parent.setMinimized(false); >+ part = pane.getPage().getActivePerspective().getPresentation().findPart("folder", null); >+ assertTrue(part instanceof ViewStack); >+ >+ >+ } catch (PartInitException e) { >+ fail(e.toString()); >+ } >+ } >+ >+ public String getInitialWindowPerspectiveId() { >+ return DurableFolderPerspective.PERSP_ID; >+ } >+ }; >+ int code = PlatformUI.createAndRunWorkbench(display, wa); >+ assertEquals(PlatformUI.RETURN_OK, code); >+ } >+ >+}
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 Raw
Flags:
bokowski
:
iplog+
Actions:
View
Attachments on
bug 213645
:
85686
| 86030 |
127977