1 /******************************************************************************* 2 * Copyright (c) 2004, 2006 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.ui.internal.dnd; 12 13 import org.eclipse.swt.graphics.Cursor; 14 import org.eclipse.swt.graphics.Rectangle; 15 16 /** 17 * This interface is used to drop objects. It knows how to drop a particular object 18 * in a particular location. IDropTargets are typically created by IDragOverListeners, and 19 * it is the job of the IDragOverListener to supply the drop target with information about 20 * the object currently being dragged. 21 * 22 * @see org.eclipse.ui.internal.dnd.IDragOverListener 23 */ 24 public interface IDropTarget { 25 26 /** 27 * Drops the object in this position 28 */ 29 void drop(); 30 31 /** 32 * Returns a cursor describing this drop operation 33 * 34 * @return a cursor describing this drop operation 35 */ 36 Cursor getCursor(); 37 38 /** 39 * Returns a rectangle (screen coordinates) describing the target location 40 * for this drop operation. 41 * 42 * @return a snap rectangle or null if this drop target does not have a specific snap 43 * location. 44 */ 45 Rectangle getSnapRectangle(); 46 } 47