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 48255 Details for
Bug 153957
[FastViews] Create Multiple FVB's
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]
Capture f changes necessary for 'smart' min/max
patch(Smart min-max).txt (text/plain), 9.27 KB, created by
Eric Moffatt
on 2006-08-20 13:29:00 EDT
(
hide
)
Description:
Capture f changes necessary for 'smart' min/max
Filename:
MIME Type:
Creator:
Eric Moffatt
Created:
2006-08-20 13:29:00 EDT
Size:
9.27 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/Perspective.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Perspective.java,v >retrieving revision 1.123 >diff -u -r1.123 Perspective.java >--- Eclipse UI/org/eclipse/ui/internal/Perspective.java 17 Aug 2006 15:42:18 -0000 1.123 >+++ Eclipse UI/org/eclipse/ui/internal/Perspective.java 20 Aug 2006 16:06:04 -0000 >@@ -375,9 +375,9 @@ > return SWT.BOTTOM; // shouldn't be able to get here... > } > >- public void moveToTrim(ViewStack stack) { >+ public void moveToTrim(ViewStack stack, int style) { > int side = calcStackSide(stack); >- FastViewBar fvb = createFastViewBar(getUniqueGroupId(), FastViewBar.GROUP_FVB , side); >+ FastViewBar fvb = createFastViewBar(getUniqueGroupId(), style, side); > > // Add all the views in the stack to teh new FVB > ArrayList refs = new ArrayList(); >@@ -399,6 +399,23 @@ > fvb.collapseGroup(); > } > >+ public void restoreZoomGroups() { >+ List toClose = new ArrayList(); >+ >+ // Get the groups to close in another list and... >+ for (Iterator fvbIter = fastViewBars.iterator(); fvbIter.hasNext();) { >+ FastViewBar fvb = (FastViewBar) fvbIter.next(); >+ if (fvb.testStyleBit(FastViewBar.ZOOM_GROUP)) >+ toClose.add(fvb); >+ } >+ >+ // ... close them >+ for (Iterator closeIter = toClose.iterator(); closeIter.hasNext();) { >+ FastViewBar fvb = (FastViewBar) closeIter.next(); >+ fvb.closeGroup(); >+ } >+ } >+ > private FastViewBar createFastViewBar(String id, int style, int side) { > // Create the FVB on the given side > WorkbenchWindow wbw = (WorkbenchWindow)page.getWorkbenchWindow(); >Index: Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java,v >retrieving revision 1.49 >diff -u -r1.49 PartSashContainer.java >--- Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java 8 May 2006 20:55:37 -0000 1.49 >+++ Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java 20 Aug 2006 16:06:02 -0000 >@@ -51,6 +51,10 @@ > private Composite parentWidget; > > private LayoutPart zoomedPart; >+ >+ // 'Smart' zoom >+ private boolean smartZoomed = false; >+ private EditorSashContainer smartHiddenEditor = null; > > protected WorkbenchPage page; > >@@ -846,6 +850,56 @@ > this.parent.setBounds(r); > } > >+ private void smartZoomIn(LayoutPart part, Perspective persp) { >+ // HACK!! since we aren't changing the 'state' maximize always >+ // get called; 'unzoom' if necessary >+ if (smartZoomed) { >+ // Restore the editor area if necessary >+ if (smartHiddenEditor != null) >+ smartHiddenEditor.setVisible(true); >+ >+ // Restore (close) and groups created during a zoom >+ persp.restoreZoomGroups(); >+ >+ // we're 'unzoomed' >+ smartZoomed = false; >+ >+ // Remember that we need to trigger a layout >+ layoutDirty = true; >+ >+ return; >+ } >+ >+ // 'Smart'(?) zoom...'minimize' all view stacks except the >+ // one we're zooming. If we're zooming the editor then -all- >+ // view stacks get minimized >+ LayoutPart[] children = getChildren(); >+ for (int i = 0; i < children.length; i++) { >+ LayoutPart child = children[i]; >+ // Close the editor stack unless it's the 'zooming' part >+ if (child instanceof EditorSashContainer && child != part) { >+ child.setVisible(false); >+ >+ // Remember it so we can restore it >+ smartHiddenEditor = (EditorSashContainer) child; >+ } >+ else if (child instanceof ViewStack) { >+ if (child != part) { >+ persp.moveToTrim((ViewStack) child, >+ FastViewBar.GROUP_FVB | FastViewBar.ZOOM_GROUP); >+ } >+ } >+ } >+ >+ // We're -not- really zoomed, don't lie >+ zoomedPart = null; >+ // ...but we're 'zoomed' >+ smartZoomed = true; >+ >+ // Remember that we need to trigger a layout >+ layoutDirty = true; >+ } >+ > /** > * Zoom in on a particular layout part. > * >@@ -857,26 +911,33 @@ > * Note: Method assumes we are active. > */ > private void zoomIn(LayoutPart part) { >+ // 'Smart'? maximize >+ Perspective persp = this.getPage().getActivePerspective(); >+ boolean useMultiFVB = (persp != null) && (System.getProperty("MultiFVB") != null); //$NON-NLS-1$ >+ if (useMultiFVB) { >+ smartZoomIn(part, persp); >+ return; >+ } >+ > // Sanity check. > if (isZoomed()) { > return; > } >- >+ > // Hide the sashes >- root.disposeSashes(); >+ root.disposeSashes(); > > // Make all parts invisible except for the zoomed part > LayoutPart[] children = getChildren(); > for (int i = 0; i < children.length; i++) { > LayoutPart child = children[i]; >- > child.setVisible(child == part); > } > > zoomedPart = part; > > // Notify the part that it has been zoomed >- part.setZoomed(true); >+ part.setZoomed(true); > > // Remember that we need to trigger a layout > layoutDirty = true; >Index: Eclipse UI/org/eclipse/ui/internal/PartStack.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartStack.java,v >retrieving revision 1.73 >diff -u -r1.73 PartStack.java >--- Eclipse UI/org/eclipse/ui/internal/PartStack.java 8 May 2006 20:55:37 -0000 1.73 >+++ Eclipse UI/org/eclipse/ui/internal/PartStack.java 20 Aug 2006 16:06:04 -0000 >@@ -1066,7 +1066,7 @@ > */ > public void setActive(int activeState) { > >- if (activeState == StackPresentation.AS_ACTIVE_FOCUS) { >+ if (activeState == StackPresentation.AS_ACTIVE_FOCUS && isMinimized) { > setMinimized(false); > } > >@@ -1160,6 +1160,14 @@ > * itself. The minimized state only affects the view when unzoomed. If the > */ > public void setMinimized(boolean minimized) { >+ // 'Smart' minimize; move the stack to the trim >+ Perspective persp = getPage().getActivePerspective(); >+ boolean useMultiFVB = (System.getProperty("MultiFVB")!= null && persp != null); //$NON-NLS-1$ >+ if (minimized && useMultiFVB && this instanceof ViewStack) { >+ persp.moveToTrim((ViewStack) this, FastViewBar.GROUP_FVB); >+ return; >+ } >+ > if (minimized != isMinimized) { > isMinimized = minimized; > >Index: Eclipse UI/org/eclipse/ui/internal/FastViewBar.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewBar.java,v >retrieving revision 1.52 >diff -u -r1.52 FastViewBar.java >--- Eclipse UI/org/eclipse/ui/internal/FastViewBar.java 17 Aug 2006 14:20:52 -0000 1.52 >+++ Eclipse UI/org/eclipse/ui/internal/FastViewBar.java 20 Aug 2006 16:06:02 -0000 >@@ -93,11 +93,13 @@ > public static final int SHOW_GROUP_BUTTON = 0x0002; > /** Causes the FVB to show the 'Add View' popup button */ > public static final int SHOW_ADD_BUTTON = 0x0004; >+ /** Indicates that the FVB was added during 'zoomIn' */ >+ public static final int ZOOM_GROUP = 0x0008; > > public static final int LEGACY_FVB = REMOVE_UNFAST_REFS | SHOW_ADD_BUTTON; > public static final int GROUP_FVB = SHOW_GROUP_BUTTON; > >- private boolean testStyleBit(int toTest) { return (style & toTest) != 0; } >+ public boolean testStyleBit(int toTest) { return (style & toTest) != 0; } > private int style = LEGACY_FVB; > > private static final int HIDDEN_WIDTH = 5; >Index: Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuMoveToTrim.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuMoveToTrim.java,v >retrieving revision 1.1 >diff -u -r1.1 SystemMenuMoveToTrim.java >--- Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuMoveToTrim.java 15 Aug 2006 20:26:15 -0000 1.1 >+++ Eclipse UI/org/eclipse/ui/internal/presentations/SystemMenuMoveToTrim.java 20 Aug 2006 16:06:04 -0000 >@@ -13,6 +13,7 @@ > import org.eclipse.jface.action.Action; > import org.eclipse.ui.IViewReference; > import org.eclipse.ui.IWorkbenchPartReference; >+import org.eclipse.ui.internal.FastViewBar; > import org.eclipse.ui.internal.Perspective; > import org.eclipse.ui.internal.ViewStack; > import org.eclipse.ui.internal.WorkbenchMessages; >@@ -92,6 +93,6 @@ > > public void run() { > Perspective psp = viewPane.getPane().getPage().getActivePerspective(); >- psp.moveToTrim((ViewStack) viewPane.getPane().getStack()); >+ psp.moveToTrim((ViewStack) viewPane.getPane().getStack(), FastViewBar.GROUP_FVB); > } > }
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 153957
:
47949
|
47960
| 48255 |
52703
|
72416