Skip to content

Package: DNDProvider

DNDProvider

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2015 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Johannes Faltermeier - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.swt.table;
15:
16: import org.eclipse.jface.viewers.AbstractTableViewer;
17: import org.eclipse.swt.dnd.DragSourceListener;
18: import org.eclipse.swt.dnd.DropTargetListener;
19: import org.eclipse.swt.dnd.Transfer;
20:
21: /**
22: * Interface to influence the D&D support which is added to the table viewer.
23: *
24: * @author Johannes Faltermeier
25: *
26: */
27: public interface DNDProvider {
28:
29:         /**
30:          * Whether DND support should be added to the table.
31:          *
32:          * @return <code>true</code> if DND will be added, based on the other methods of this interface, or
33:          * <code>false</code> if DND should not be added
34:          */
35:         boolean hasDND();
36:
37:         /**
38:          * Returns the drag operations bits used to setup the
39:          * {@link AbstractTableViewer#addDragSupport(int, Transfer[], DragSourceListener) drag support} for the viewer.
40:          *
41:          * @return the drag operations
42:          */
43:         int getDragOperations();
44:
45:         /**
46:          * Returns the drag transfer types used to setup the
47:          * {@link AbstractTableViewer#addDragSupport(int, Transfer[], DragSourceListener) drag support} for the viewer.
48:          *
49:          * @return the drag {@link Transfer transfer types}
50:          */
51:         Transfer[] getDragTransferTypes();
52:
53:         /**
54:          * Returns the {@link DragSourceListener} used to setup the
55:          * {@link AbstractTableViewer#addDragSupport(int, Transfer[], DragSourceListener) drag support} for the viewer.
56:          *
57:          * @param tableViewer the AbstractTableViewer
58:          * @return the listener
59:          */
60:         DragSourceListener getDragListener(AbstractTableViewer tableViewer);
61:
62:         /**
63:          * Returns the drag operations bits used to setup the
64:          * {@link AbstractTableViewer#addDropSupport(int, Transfer[], DropTargetListener) drop support} for the viewer.
65:          *
66:          * @return the drop operations
67:          */
68:         int getDropOperations();
69:
70:         /**
71:          * Returns the drag transfer types used to setup the
72:          * {@link AbstractTableViewer#addDropSupport(int, Transfer[], DropTargetListener) drop support} for the viewer.
73:          *
74:          * @return the drop {@link Transfer transfer types}
75:          */
76:         Transfer[] getDropTransferTypes();
77:
78:         /**
79:          * Returns the {@link DragSourceListener} used to setup the
80:          * {@link AbstractTableViewer#addDropSupport(int, Transfer[], DropTargetListener) drop support} for the viewer.
81:          *
82:          * @param tableViewer the AbstractTableViewer
83:          * @return the listener
84:          */
85:         DropTargetListener getDropListener(AbstractTableViewer tableViewer);
86:
87: }