Package org.eclipse.ui.presentations

Examples of org.eclipse.ui.presentations.StackDropResult


              getWorkbenchWindow().getWorkbench());
        if (differentWindows && !editorDropOK) {
            return null;
        }

        StackDropResult dropResult = getPresentation().dragOver(
                getControl(), position);
       
        if (dropResult == null) {
          return null;
        }
View Full Code Here


                }

                if (dragStart >= 0) {
                    dragOverIndex--;

                    return new StackDropResult(lastTabBounds, new Integer(
                            dragOverIndex));
                }

                // Make the drag-over rectangle look like a tab at the end of the tab region.
                // We don't actually know how wide the tab will be when it's dropped, so just
                // make it 3 times wider than it is tall.
                Rectangle dropRectangle = titleArea;

                dropRectangle.x = lastTabBounds.x + lastTabBounds.width;
                dropRectangle.width = 3 * dropRectangle.height;
                return new StackDropResult(dropRectangle, new Integer(
                        dragOverIndex));

            } else {
                // If the closest side is the side with the tabs, consider this a stack operation.
                // Otherwise, let the drop fall through to whatever the default behavior is
                Rectangle displayBounds = DragUtil.getDisplayBounds(tabFolder.getControl());
                int closestSide = Geometry.getClosestSide(displayBounds, location);
                if (closestSide == tabFolder.getTabPosition()) {
                    return new StackDropResult(displayBounds, null);
                }
               
                return null;
            }
        }

        if (!tabUnderPointer.isShowing()) {
            return null;
        }
       
        Rectangle tabBounds = tabUnderPointer.getBounds();
       
        if (tabBounds.isEmpty()) {
            return null;
        }

        return new StackDropResult(tabBounds, new DragCookie(tabFolder
                .indexOf(tabUnderPointer)));
    }
View Full Code Here

          target = folder.getDropTarget(draggedObject, position);
         
          if (target == null) {
            Rectangle displayBounds = DragUtil.getDisplayBounds(folder.getControl());
            if (displayBounds.contains(position)) {
                target = folder.createDropTarget(sourcePart, new StackDropResult(displayBounds, null));
            } else {
                return null;
            }
          }
        }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.presentations.StackDropResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.