1
|
/**
|
2
|
*
|
3
|
*/
|
4
|
package eu.etaxonomy.taxeditor.editor.name;
|
5
|
|
6
|
import org.eclipse.swt.dnd.DropTargetEffect;
|
7
|
import org.eclipse.swt.dnd.DropTargetEvent;
|
8
|
import org.eclipse.swt.widgets.Control;
|
9
|
|
10
|
import eu.etaxonomy.taxeditor.editor.EditorUtil;
|
11
|
import eu.etaxonomy.taxeditor.editor.IDropTargetable;
|
12
|
import eu.etaxonomy.taxeditor.preference.Resources;
|
13
|
|
14
|
/**
|
15
|
* <p>NameEditorDropTargetEffect class.</p>
|
16
|
*
|
17
|
* @author n.hoffmann
|
18
|
* @version $Id: $
|
19
|
*/
|
20
|
public class NameEditorDropTargetEffect extends DropTargetEffect {
|
21
|
|
22
|
/**
|
23
|
* <p>Constructor for NameEditorDropTargetEffect.</p>
|
24
|
*
|
25
|
* @param control a {@link org.eclipse.swt.widgets.Control} object.
|
26
|
*/
|
27
|
public NameEditorDropTargetEffect(Control control) {
|
28
|
super(control);
|
29
|
}
|
30
|
|
31
|
/** {@inheritDoc} */
|
32
|
public void dragEnter(DropTargetEvent dropTargetEvent) {
|
33
|
|
34
|
|
35
|
|
36
|
if(dropTargetEvent.widget instanceof IDropTargetable){
|
37
|
((IDropTargetable) dropTargetEvent.widget).dragEntered();
|
38
|
}
|
39
|
|
40
|
// if(! EditorUtil.getActiveMultiPageTaxonEditor().equals(editor.getMultiPageTaxonEditor())){
|
41
|
// editor.getMultiPageTaxonEditor().setFocus();
|
42
|
// }
|
43
|
}
|
44
|
|
45
|
/** {@inheritDoc} */
|
46
|
public void dragLeave(DropTargetEvent dropTargetEvent) {
|
47
|
|
48
|
|
49
|
|
50
|
if(dropTargetEvent.widget instanceof Control){
|
51
|
((Control) dropTargetEvent.widget).setBackground(EditorUtil.getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
|
52
|
}
|
53
|
}
|
54
|
|
55
|
}
|