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 7556 Details for
Bug 13585
[View Mgmt] Please bring back floating/detached views
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]
Prettier alternative without the OS native trim
13585_patch_nonativetrim.txt (text/plain), 7.73 KB, created by
Stefan Xenos
on 2004-01-24 20:17:52 EST
(
hide
)
Description:
Prettier alternative without the OS native trim
Filename:
MIME Type:
Creator:
Stefan Xenos
Created:
2004-01-24 20:17:52 EST
Size:
7.73 KB
patch
obsolete
>Index: Eclipse UI/org/eclipse/ui/internal/DetachedWindow.java >=================================================================== >retrieving revision 1.6.12.7 >diff -u -r1.6.12.7 DetachedWindow.java >--- Eclipse UI/org/eclipse/ui/internal/DetachedWindow.java 21 Jan 2004 19:46:01 -0000 1.6.12.7 >+++ Eclipse UI/org/eclipse/ui/internal/DetachedWindow.java 25 Jan 2004 01:02:46 -0000 >@@ -11,11 +11,12 @@ > > package org.eclipse.ui.internal; > >+import java.util.ArrayList; > import java.util.Enumeration; >+import java.util.Iterator; > import java.util.List; > import java.util.Vector; > >-import org.eclipse.jface.window.Window; > import org.eclipse.swt.SWT; > import org.eclipse.swt.custom.CTabFolder2; > import org.eclipse.swt.graphics.Rectangle; >@@ -24,6 +25,9 @@ > import org.eclipse.swt.widgets.Event; > import org.eclipse.swt.widgets.Listener; > import org.eclipse.swt.widgets.Shell; >+ >+import org.eclipse.jface.window.Window; >+ > import org.eclipse.ui.IMemento; > import org.eclipse.ui.IWorkbenchPage; > import org.eclipse.ui.help.WorkbenchHelp; >@@ -41,8 +45,8 @@ > */ > public DetachedWindow(WorkbenchPage workbenchPage) { > super(workbenchPage.getWorkbenchWindow().getShell()); >- setShellStyle(/* SWT.CLOSE | SWT.MIN | SWT.MAX | */ >- SWT.RESIZE); >+ setShellStyle( //SWT.CLOSE | SWT.MIN | SWT.MAX | >+ SWT.RESIZE ); > this.page = workbenchPage; > folder = new PartTabFolder(); > } >@@ -138,15 +142,16 @@ > * Close has been pressed. Close all views. > */ > protected void handleShellCloseEvent() { >- // List views = new ArrayList(); >- // collectViewPanes(views, getChildren()); >- // Iterator enum = views.iterator(); >- // while (enum.hasNext()) { >- // ViewPane child = (ViewPane)enum.next(); >- // page.hideView(child.getViewPart()); >- // } >- // close(); >+ List views = new ArrayList(); >+ collectViewPanes(views, getChildren()); >+ Iterator enum = views.iterator(); >+ while (enum.hasNext()) { >+ ViewPane child = (ViewPane)enum.next(); >+ page.hideView(child.getViewReference()); >+ } >+ close(); > } >+ > protected void initializeBounds() { > if (bounds != null) > getShell().setBounds(bounds); >@@ -212,4 +217,17 @@ > return folder.getControl(); > } > >+ /* (non-Javadoc) >+ * @see org.eclipse.jface.window.Window#getConstrainedShellSize(org.eclipse.swt.graphics.Rectangle) >+ */ >+ protected Rectangle getConstrainedShellSize(Rectangle preferredSize) { >+ Rectangle displayBounds = getShell().getDisplay().getBounds(); >+ >+ // As long as the initial position is somewhere on the display, don't mess with it. >+ if (displayBounds.intersects(preferredSize)) { >+ return preferredSize; >+ } >+ >+ return super.getConstrainedShellSize(preferredSize); >+ } > } >Index: Eclipse UI/org/eclipse/ui/internal/PerspectivePresentation.java >=================================================================== >retrieving revision 1.15.4.13 >diff -u -r1.15.4.13 PerspectivePresentation.java >--- Eclipse UI/org/eclipse/ui/internal/PerspectivePresentation.java 23 Jan 2004 18:28:24 -0000 1.15.4.13 >+++ Eclipse UI/org/eclipse/ui/internal/PerspectivePresentation.java 25 Jan 2004 01:02:46 -0000 >@@ -291,24 +291,6 @@ > } > > /** >- * Answer a list of the view panes. >- */ >- private DetachedWindow[] collectDetachedWindows(Window[] windows) { >- DetachedWindow[] result = new DetachedWindow[0]; >- for (int i = 0, length = windows.length; i < length; i++) { >- if (windows[i] instanceof DetachedWindow >- && ((DetachedWindow) windows[i]).belongsToWorkbenchPage(page)) { >- DetachedWindow[] newResult = >- new DetachedWindow[result.length + 1]; >- System.arraycopy(result, 0, newResult, 0, result.length); >- newResult[result.length] = (DetachedWindow) windows[i]; >- result = newResult; >- } >- } >- return result; >- } >- >- /** > * Open the tracker to allow the user to move the specified part using > * keyboard. > */ >@@ -316,22 +298,6 @@ > DragUtil.performDrag(pane, DragUtil.getDisplayBounds(pane.getControl())); > } > /** >- * Answer a list of the view panes. >- */ >- private void collectDragParts(List result, LayoutPart[] parts) { >- for (int i = 0, length = parts.length; i < length; i++) { >- LayoutPart part = parts[i]; >- if (part instanceof ViewPane) { >- result.add(part); >- } else if (part instanceof ILayoutContainer) { >- collectDragParts( >- result, >- ((ILayoutContainer) part).getChildren()); >- } >- } >- } >- >- /** > * Answer a list of the PartPlaceholder objects. > */ > private PartPlaceholder[] collectPlaceholders() { >@@ -440,7 +406,7 @@ > disableAllDrag(); > > // Reparent all views to the main window >- Composite parent = (Composite) mainLayout.getParent(); >+ Composite parent = mainLayout.getParent(); > Vector children = new Vector(); > collectViewPanes(children, mainLayout.getChildren()); > >@@ -477,7 +443,7 @@ > ILayoutContainer oldContainer = part.getContainer(); > > // Reparent the part back to the main window >- part.reparent((Composite) mainLayout.getParent()); >+ part.reparent(mainLayout.getParent()); > > // Update container. > if (oldContainer == null) >@@ -903,7 +869,7 @@ > } else if (newContainer instanceof PartTabFolder) { > // move this part relative to the folder > // rather than relative to the part in the folder >- movePart(part, position, (PartTabFolder) newContainer); >+ movePart(part, position, newContainer); > } > } > /** >@@ -979,14 +945,16 @@ > // If drop target is not registered object then reject. > if (e.dropTarget == null > && e.relativePosition != DragCursors.OFFSCREEN) { >- e.dropTarget = null; >- e.relativePosition = offScreenPosition; >+ e.relativePosition = DragCursors.INVALID; >+ //e.dropTarget = null; >+ //e.relativePosition = offScreenPosition; > return; > } > > // If drop target is not over view, or tab folder, reject. > if (!(e.dropTarget instanceof ViewPane > || e.dropTarget instanceof PartTabFolder)) { >+ //e.relativePosition = DragCursors.INVALID; > e.dropTarget = null; > e.relativePosition = offScreenPosition; > return; >@@ -994,6 +962,14 @@ > > // If drag source is view .. > if (e.dragSource instanceof ViewPane) { >+ // If target is detached window force stacking. >+ Window window = e.dropTarget.getWindow(); >+ if (window instanceof DetachedWindow) { >+ //e.relativePosition = DragCursors.CENTER; >+ e.relativePosition = offScreenPosition; >+ return; >+ } >+ > if (e.dragSource == e.dropTarget) { > // Reject stack onto same view > if (e.relativePosition == DragCursors.CENTER) { >@@ -1023,13 +999,6 @@ > e.relativePosition = DragCursors.INVALID; > return; > } >- } >- >- // If target is detached window force stacking. >- Window window = e.dropTarget.getWindow(); >- if (window instanceof DetachedWindow) { >- e.relativePosition = DragCursors.CENTER; >- return; > } > > // All seems well >Index: Eclipse UI/org/eclipse/ui/internal/dnd/CompatibilityDragTarget.java >=================================================================== >retrieving revision 1.1.2.1 >diff -u -r1.1.2.1 CompatibilityDragTarget.java >--- Eclipse UI/org/eclipse/ui/internal/dnd/CompatibilityDragTarget.java 21 Jan 2004 19:46:01 -0000 1.1.2.1 >+++ Eclipse UI/org/eclipse/ui/internal/dnd/CompatibilityDragTarget.java 25 Jan 2004 01:02:46 -0000 >@@ -192,12 +192,10 @@ > > PartDropEvent dropEvent = createDropEvent(currentControl, position, source, new Point(dragRectangle.x, dragRectangle.y)); > >+ listener.dragOver(dropEvent); >+ > if (dropEvent.relativePosition != DragCursors.INVALID) { >- listener.dragOver(dropEvent); >- >- if (dropEvent.relativePosition != DragCursors.INVALID) { >- return new DropTarget(dropEvent); >- } >+ return new DropTarget(dropEvent); > } > } >
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 13585
:
6703
|
6705
|
7539
| 7556