KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > dnd > IDragAndDropService


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 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
12 package org.eclipse.ui.dnd;
13
14 import org.eclipse.swt.dnd.DropTargetListener;
15 import org.eclipse.swt.dnd.Transfer;
16 import org.eclipse.swt.widgets.Control;
17
18 /**
19  * This interface specifies the API for a service to be used by part authors to
20  * access methods which provide support for Drag and Drop operations within the
21  * workbench.
22  * <p>
23  * Authors should access this service using the PartSite's
24  * <code>getService</code> method, passing this interface as the argument.
25  * </p>
26  * <p>
27  * <b>NOTE:</b> This interface it not expected to be implemented by clients; it
28  * is provided only to allow access to the service's methods.
29  * </p>
30  * <p>
31  *
32  * @since 3.3
33  *
34  */

35 public interface IDragAndDropService {
36     /**
37      * Causes a drop target to be added to the given control that respects the
38      * existing site's drop behaviour in addition to the behaviour being
39      * specified for the given control.
40      * <p>
41      * If a transfer type specified for the control matches one used by the site
42      * then the control's listener is called (the client is overriding the
43      * existing site behaviour which will no longer work).
44      * </p>
45      * <p>
46      * NOTE: Site authors <b>must</b> use this method to add drop behaviour;
47      * directly adding drop targets using SWT onto a site will cause the
48      * standard site behaviour (i.e. dragging files / markers into the
49      * EditorSite...) to not work when that editor is active.
50      * </p>
51      * <p>
52      * Note that this method may be used more than once should the part author
53      * wish to register different drop targets for internal controls (i.e. to
54      * support internal DnD).
55      * </p>
56      * <p>
57      *
58      * @param control
59      * The control to add the drop behaviour to
60      * @param ops
61      * The Drop operations used by this target
62      * @param transfers
63      * The TransferTypes used by this target
64      * @param listener
65      * The listener controlling the target's behaviour
66      */

67     public void addMergedDropTarget(Control control, int ops, Transfer[] transfers, DropTargetListener listener);
68     
69     /**
70      * Remove any previously 'merged' drop target for this Control
71      *
72      * @param control The control to remove the drop target for
73      */

74     public void removeMergedDropTarget(Control control);
75 }
76
Popular Tags