Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 153957 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/internal/Perspective.java (-2 / +19 lines)
Lines 375-383 Link Here
375
    	return SWT.BOTTOM; // shouldn't be able to get here...
375
    	return SWT.BOTTOM; // shouldn't be able to get here...
376
    }
376
    }
377
    
377
    
378
    public void moveToTrim(ViewStack stack) {
378
    public void moveToTrim(ViewStack stack, int style) {
379
    	int side = calcStackSide(stack);
379
    	int side = calcStackSide(stack);
380
    	FastViewBar fvb = createFastViewBar(getUniqueGroupId(), FastViewBar.GROUP_FVB , side);
380
    	FastViewBar fvb = createFastViewBar(getUniqueGroupId(), style, side);
381
    	
381
    	
382
    	// Add all the views in the stack to teh new FVB
382
    	// Add all the views in the stack to teh new FVB
383
    	ArrayList refs = new ArrayList();
383
    	ArrayList refs = new ArrayList();
Lines 399-404 Link Here
399
    	fvb.collapseGroup();
399
    	fvb.collapseGroup();
400
    }
400
    }
401
    
401
    
402
    public void restoreZoomGroups() {
403
		List toClose = new ArrayList();
404
		
405
		// Get the groups to close in another list and...
406
    	for (Iterator fvbIter = fastViewBars.iterator(); fvbIter.hasNext();) {
407
			FastViewBar fvb = (FastViewBar) fvbIter.next();
408
			if (fvb.testStyleBit(FastViewBar.ZOOM_GROUP))
409
				toClose.add(fvb);
410
		}
411
    	
412
    	// ... close them
413
    	for (Iterator closeIter = toClose.iterator(); closeIter.hasNext();) {
414
			FastViewBar fvb = (FastViewBar) closeIter.next();
415
				fvb.closeGroup();
416
		}
417
    }
418
    
402
    private FastViewBar createFastViewBar(String id, int style, int side) {   	
419
    private FastViewBar createFastViewBar(String id, int style, int side) {   	
403
    	// Create the FVB on the given side
420
    	// Create the FVB on the given side
404
    	WorkbenchWindow wbw = (WorkbenchWindow)page.getWorkbenchWindow();
421
    	WorkbenchWindow wbw = (WorkbenchWindow)page.getWorkbenchWindow();
(-)Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java (-4 / +65 lines)
Lines 51-56 Link Here
51
    private Composite parentWidget;
51
    private Composite parentWidget;
52
52
53
    private LayoutPart zoomedPart;
53
    private LayoutPart zoomedPart;
54
    
55
    // 'Smart' zoom
56
    private boolean smartZoomed = false;
57
    private EditorSashContainer smartHiddenEditor = null;
54
58
55
    protected WorkbenchPage page;
59
    protected WorkbenchPage page;
56
60
Lines 846-851 Link Here
846
        this.parent.setBounds(r);
850
        this.parent.setBounds(r);
847
    }
851
    }
848
852
853
    private void smartZoomIn(LayoutPart part, Perspective persp) {
854
    	// HACK!! since we aren't changing the 'state' maximize always
855
    	// get called; 'unzoom' if necessary
856
    	if (smartZoomed) {
857
    		// Restore the editor area if necessary
858
    		if (smartHiddenEditor != null)
859
    			smartHiddenEditor.setVisible(true);
860
    		
861
    		// Restore (close) and groups created during a zoom
862
            persp.restoreZoomGroups();
863
            
864
            // we're 'unzoomed'
865
            smartZoomed = false;
866
            
867
            // Remember that we need to trigger a layout
868
            layoutDirty = true;
869
870
            return;
871
    	}
872
    	
873
    	// 'Smart'(?) zoom...'minimize' all view stacks except the
874
    	// one we're zooming. If we're zooming the editor then -all-
875
    	// view stacks get minimized
876
        LayoutPart[] children = getChildren();
877
        for (int i = 0; i < children.length; i++) {
878
            LayoutPart child = children[i];
879
    		// Close the editor stack unless it's the 'zooming' part
880
    		if (child instanceof EditorSashContainer && child != part) { 
881
    			child.setVisible(false);
882
    			
883
    			// Remember it so we can restore it
884
    			smartHiddenEditor = (EditorSashContainer) child;
885
    		}
886
    		else if (child instanceof ViewStack) {
887
    			if (child != part) {
888
        			persp.moveToTrim((ViewStack) child, 
889
        					FastViewBar.GROUP_FVB | FastViewBar.ZOOM_GROUP);
890
    			}
891
    		}
892
        }
893
        
894
        // We're -not- really zoomed, don't lie
895
        zoomedPart = null;
896
        // ...but we're 'zoomed'
897
        smartZoomed = true;
898
        
899
        // Remember that we need to trigger a layout
900
            layoutDirty = true;
901
    }
902
    
849
    /**
903
    /**
850
     * Zoom in on a particular layout part.
904
     * Zoom in on a particular layout part.
851
     *
905
     *
Lines 857-882 Link Here
857
     * Note: Method assumes we are active.
911
     * Note: Method assumes we are active.
858
     */
912
     */
859
    private void zoomIn(LayoutPart part) {
913
    private void zoomIn(LayoutPart part) {
914
        // 'Smart'? maximize
915
		Perspective persp = this.getPage().getActivePerspective();
916
    	boolean useMultiFVB = (persp != null) && (System.getProperty("MultiFVB") != null); //$NON-NLS-1$
917
    	if (useMultiFVB) {
918
    		smartZoomIn(part, persp);
919
    		return;
920
    	}
921
    	
860
        // Sanity check.
922
        // Sanity check.
861
        if (isZoomed()) {
923
        if (isZoomed()) {
862
			return;
924
			return;
863
		}
925
		}
864
        
926
865
        // Hide the sashes
927
        // Hide the sashes
866
        root.disposeSashes();
928
   		root.disposeSashes();
867
        
929
        
868
        // Make all parts invisible except for the zoomed part
930
        // Make all parts invisible except for the zoomed part
869
        LayoutPart[] children = getChildren();
931
        LayoutPart[] children = getChildren();
870
        for (int i = 0; i < children.length; i++) {
932
        for (int i = 0; i < children.length; i++) {
871
            LayoutPart child = children[i];
933
            LayoutPart child = children[i];
872
            
873
            child.setVisible(child == part);
934
            child.setVisible(child == part);
874
        }
935
        }
875
        
936
        
876
        zoomedPart = part;
937
        zoomedPart = part;
877
                
938
                
878
        // Notify the part that it has been zoomed
939
        // Notify the part that it has been zoomed
879
        part.setZoomed(true);
940
    	part.setZoomed(true);
880
        
941
        
881
        // Remember that we need to trigger a layout
942
        // Remember that we need to trigger a layout
882
        layoutDirty = true;
943
        layoutDirty = true;
(-)Eclipse UI/org/eclipse/ui/internal/PartStack.java (-1 / +9 lines)
Lines 1066-1072 Link Here
1066
     */
1066
     */
1067
    public void setActive(int activeState) {
1067
    public void setActive(int activeState) {
1068
1068
1069
        if (activeState == StackPresentation.AS_ACTIVE_FOCUS) {
1069
        if (activeState == StackPresentation.AS_ACTIVE_FOCUS && isMinimized) {
1070
            setMinimized(false);
1070
            setMinimized(false);
1071
        }
1071
        }
1072
1072
Lines 1160-1165 Link Here
1160
     * itself. The minimized state only affects the view when unzoomed. If the 
1160
     * itself. The minimized state only affects the view when unzoomed. If the 
1161
     */
1161
     */
1162
    public void setMinimized(boolean minimized) {
1162
    public void setMinimized(boolean minimized) {
1163
    	// 'Smart' minimize; move the stack to the trim
1164
    	Perspective persp = getPage().getActivePerspective();
1165
    	boolean useMultiFVB = (System.getProperty("MultiFVB")!= null && persp != null); //$NON-NLS-1$
1166
    	if (minimized && useMultiFVB && this instanceof ViewStack) {
1167
    		persp.moveToTrim((ViewStack) this, FastViewBar.GROUP_FVB);
1168
    		return;
1169
    	}
1170
    	
1163
        if (minimized != isMinimized) {
1171
        if (minimized != isMinimized) {
1164
            isMinimized = minimized;
1172
            isMinimized = minimized;
1165
            
1173
            
(-)Eclipse UI/org/eclipse/ui/internal/FastViewBar.java (-1 / +3 lines)
Lines 93-103 Link Here
93
    public static final int SHOW_GROUP_BUTTON = 0x0002;
93
    public static final int SHOW_GROUP_BUTTON = 0x0002;
94
    /** Causes the FVB to show the 'Add View' popup button */
94
    /** Causes the FVB to show the 'Add View' popup button */
95
    public static final int SHOW_ADD_BUTTON = 0x0004;
95
    public static final int SHOW_ADD_BUTTON = 0x0004;
96
    /** Indicates that the FVB was added during 'zoomIn' */
97
    public static final int ZOOM_GROUP = 0x0008;
96
    
98
    
97
    public static final int LEGACY_FVB = REMOVE_UNFAST_REFS | SHOW_ADD_BUTTON;
99
    public static final int LEGACY_FVB = REMOVE_UNFAST_REFS | SHOW_ADD_BUTTON;
98
    public static final int GROUP_FVB = SHOW_GROUP_BUTTON;
100
    public static final int GROUP_FVB = SHOW_GROUP_BUTTON;
99
    
101
    
100
    private boolean testStyleBit(int toTest) { return (style & toTest) != 0; }
102
    public boolean testStyleBit(int toTest) { return (style & toTest) != 0; }
101
    private int style = LEGACY_FVB;
103
    private int style = LEGACY_FVB;
102
    
104
    
103
    private static final int HIDDEN_WIDTH = 5;
105
    private static final int HIDDEN_WIDTH = 5;
(-)Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuMoveToTrim.java (-1 / +2 lines)
Lines 13-18 Link Here
13
import org.eclipse.jface.action.Action;
13
import org.eclipse.jface.action.Action;
14
import org.eclipse.ui.IViewReference;
14
import org.eclipse.ui.IViewReference;
15
import org.eclipse.ui.IWorkbenchPartReference;
15
import org.eclipse.ui.IWorkbenchPartReference;
16
import org.eclipse.ui.internal.FastViewBar;
16
import org.eclipse.ui.internal.Perspective;
17
import org.eclipse.ui.internal.Perspective;
17
import org.eclipse.ui.internal.ViewStack;
18
import org.eclipse.ui.internal.ViewStack;
18
import org.eclipse.ui.internal.WorkbenchMessages;
19
import org.eclipse.ui.internal.WorkbenchMessages;
Lines 92-97 Link Here
92
93
93
    public void run() {
94
    public void run() {
94
        Perspective psp = viewPane.getPane().getPage().getActivePerspective();
95
        Perspective psp = viewPane.getPane().getPage().getActivePerspective();
95
        psp.moveToTrim((ViewStack) viewPane.getPane().getStack());
96
        psp.moveToTrim((ViewStack) viewPane.getPane().getStack(), FastViewBar.GROUP_FVB);
96
    }
97
    }
97
}
98
}

Return to bug 153957