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 2048 Details for
Bug 5089
[Navigator] Dragging should occur with the middle mouse button on Linux
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Fixed drag and drop
ShortcutBarPartDragDrop.java (text/plain), 2.39 KB, created by
Knut Radloff
on 2002-09-23 18:15:18 EDT
(
hide
)
Description:
Fixed drag and drop
Filename:
MIME Type:
Creator:
Knut Radloff
Created:
2002-09-23 18:15:18 EDT
Size:
2.39 KB
patch
obsolete
>package org.eclipse.ui.internal; > >/********************************************************************** >Copyright (c) 2000, 2002 IBM Corp. and others. >All rights reserved. This program and the accompanying materials >are made available under the terms of the Common Public License v0.5 >which accompanies this distribution, and is available at >http://www.eclipse.org/legal/cpl-v05.html >**********************************************************************/ >import org.eclipse.swt.events.*; >import org.eclipse.swt.graphics.*; >import org.eclipse.swt.widgets.*; >import org.eclipse.ui.IViewPart; > >public class ShortcutBarPartDragDrop extends PartDragDrop { > // The item that is being dragged by this PartDragDrop. > private ToolItem draggedItem; > > public ShortcutBarPartDragDrop(LayoutPart itemPart, Control shortcutBar) { > super(itemPart, shortcutBar); > } > /** * @see org.eclipse.ui.internal.PartDragDrop#isDragAllowed(Point) */ > protected void isDragAllowed(Point position) { > ToolBar toolBar = getToolBar(); > draggedItem = toolBar.getItem(position); > if (draggedItem == null) { > // Avoid drag from the borders. > return; > } > if (draggedItem.getData(ShowFastViewContribution.FAST_VIEW) == null) { > // Avoid drag from non-fast view icons. > return; > } > super.isDragAllowed(position); > } > > // Returns the shortcut bar. > private ToolBar getToolBar() { > return (ToolBar) getDragControl(); > } > /*package*/ ToolItem getDraggedItem() { > return draggedItem; > } > > /* > * Returns the bounds of the fast view of the view > * represented by the icon being dragged. > */ > protected Rectangle getSourceBounds() { > IViewPart part = (IViewPart) draggedItem.getData(ShowFastViewContribution.FAST_VIEW); > WorkbenchPage page = (WorkbenchPage) part.getSite().getPage(); > Perspective persp = page.getActivePerspective(); > Rectangle rect = persp.getFastViewBounds(part); > return rect; > } > /* > * The cursor has moved enough to open a tracker only if it is > * NOT still over the icon being dragged. A tracker consumes > * events from the queue. If a tracker is opened while we are still > * over the pushed ToolItem, it will never be "unpushed", since the > * event that unpushes it will be consumed by the tracker. > */ > protected boolean hasMovedEnough(MouseEvent e) { > ToolItem currentItem = getToolBar().getItem(new Point(e.x, e.y)); > if (super.hasMovedEnough(e) && currentItem != draggedItem) > return true; > return false; > } >}
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
Actions:
View
Attachments on
bug 5089
:
2046
|
2047
| 2048