/ org.eclipsetrader.releng / durable_folder.patch
durable_folder.patch
  1  ### Eclipse Workspace Patch 1.0
  2  #P org.eclipse.ui.workbench
  3  Index: Eclipse UI/org/eclipse/ui/internal/ViewSashContainer.java
  4  ===================================================================
  5  --- Eclipse UI/org/eclipse/ui/internal/ViewSashContainer.java	(revisione 1609)
  6  +++ Eclipse UI/org/eclipse/ui/internal/ViewSashContainer.java	(copia locale)
  7  @@ -12,7 +12,6 @@
  8   
  9   import java.util.HashMap;
 10   import java.util.Map;
 11  -
 12   import org.eclipse.core.runtime.IStatus;
 13   import org.eclipse.core.runtime.MultiStatus;
 14   import org.eclipse.swt.widgets.Composite;
 15  Index: Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java
 16  ===================================================================
 17  --- Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java	(revisione 1609)
 18  +++ Eclipse UI/org/eclipse/ui/internal/PerspectiveHelper.java	(copia locale)
 19  @@ -99,6 +99,8 @@
 20   
 21       protected ActualDropTarget dropTarget;
 22       
 23  +	private List restoreFastViewsList = new ArrayList();
 24  +
 25       private IDragOverListener dragTarget = new IDragOverListener() {
 26   
 27           public IDropTarget drag(Control currentControl, Object draggedObject,
 28  @@ -1321,13 +1323,13 @@
 29        * fact to locate the parent.
 30        */
 31       public void replacePlaceholderWithPart(LayoutPart part) {
 32  -        
 33  +		restoreDurable();
 34           // Look for a PartPlaceholder that will tell us how to position this
 35           // object
 36           PartPlaceholder[] placeholders = collectPlaceholders();
 37           for (int i = 0, length = placeholders.length; i < length; i++) {
 38  -            if (placeholders[i].getCompoundId().equals(part.getCompoundId())) {
 39  -                // found a matching placeholder which we can replace with the
 40  +			if (placeholders[i].getCompoundId().equals(part.getCompoundId())) {
 41  +				// found a matching placeholder which we can replace with the
 42                   // new View
 43                   ILayoutContainer container = placeholders[i].getContainer();
 44                   if (container != null) {
 45  @@ -1347,21 +1349,50 @@
 46                       }
 47                       container.replace(placeholders[i], part);
 48                       return;
 49  -                }
 50  -            }
 51  +				}
 52  +			}
 53           }
 54  +	}
 55   
 56  +	private void restoreDurable() {
 57  +		LayoutPart[] children = mainLayout.getChildren();
 58  +
 59  +		for (int i = 0; i < children.length; i++) {
 60  +			LayoutPart t = children[i];
 61  +			if (t instanceof ContainerPlaceholder) {
 62  +				LayoutPart r = ((ContainerPlaceholder) t).getRealContainer();
 63  +				if (r instanceof ViewStack) {
 64  +					ViewStack viewStack = (ViewStack) r;
 65  +					viewStack.setDurable(page.window.getWindowAdvisor().isDurableFolder(
 66  +							perspective.getDesc().getId(), r.getID()));
 67  +					if (viewStack.getDurable() && !restoreFastViewsList.contains(viewStack.getID())) {
 68  +						t.container.replace(t, r);
 69  +					}
 70  +				}
 71  +			}
 72  +		}
 73  +		// restoreFastViewsList.clear();
 74       }
 75   
 76       /**
 77        * @see org.eclipse.ui.IPersistable
 78        */
 79  -    public IStatus restoreState(IMemento memento) {
 80  +	public IStatus restoreState(IMemento parent, IMemento memento) {
 81           // Restore main window.
 82           IMemento childMem = memento
 83                   .getChild(IWorkbenchConstants.TAG_MAIN_WINDOW);
 84           IStatus r = mainLayout.restoreState(childMem);
 85   
 86  +		IMemento barsMem = parent.getChild(IWorkbenchConstants.TAG_FAST_VIEW_BARS);
 87  +		if (barsMem != null) {
 88  +			IMemento[] bars = barsMem.getChildren(IWorkbenchConstants.TAG_FAST_VIEW_BAR);
 89  +
 90  +			for (int i = 0; i < bars.length; i++) {
 91  +				final String id = bars[i].getString(IWorkbenchConstants.TAG_ID);
 92  +				restoreFastViewsList.add(id);
 93  +			}
 94  +		}
 95  +
 96           // Restore each floating window.
 97           if (detachable) {
 98               IMemento detachedWindows[] = memento
 99  Index: Eclipse UI/org/eclipse/ui/internal/Perspective.java
100  ===================================================================
101  --- Eclipse UI/org/eclipse/ui/internal/Perspective.java	(revisione 1609)
102  +++ Eclipse UI/org/eclipse/ui/internal/Perspective.java	(copia locale)
103  @@ -1306,7 +1306,7 @@
104           final PerspectiveHelper pres = presArray[0];
105   
106           // Read the layout.
107  -        result.merge(pres.restoreState(memento
108  +		result.merge(pres.restoreState(memento, memento
109                   .getChild(IWorkbenchConstants.TAG_LAYOUT)));
110   
111           StartupThreading.runWithoutExceptions(new StartupRunnable() {
112  Index: META-INF/MANIFEST.MF
113  ===================================================================
114  --- META-INF/MANIFEST.MF	(revisione 1609)
115  +++ META-INF/MANIFEST.MF	(copia locale)
116  @@ -2,7 +2,7 @@
117   Bundle-ManifestVersion: 2
118   Bundle-Name: %pluginName
119   Bundle-SymbolicName: org.eclipse.ui.workbench; singleton:=true
120  -Bundle-Version: 3.7.0.qualifier
121  +Bundle-Version: 3.7.0.I20111020-0925-ET
122   Bundle-ClassPath: e4-workbench.jar,
123    compatibility.jar,
124    .