Project

General

Profile

Download (1.02 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
 *
3
 */
4
package eu.etaxonomy.taxeditor.editor.name.e4.dnd;
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.name.e4.IDropTargetableE4;
12
import eu.etaxonomy.taxeditor.preference.Resources;
13

    
14
/**
15
 *
16
 * @author n.hoffmann
17
 * @version $Id: $
18
 */
19
public class NameEditorDropTargetEffect extends DropTargetEffect {
20

    
21
	public NameEditorDropTargetEffect(Control control) {
22
		super(control);
23
	}
24

    
25
	/** {@inheritDoc} */
26
	@Override
27
    public void dragEnter(DropTargetEvent dropTargetEvent) {
28
		if(dropTargetEvent.widget instanceof IDropTargetableE4){
29
			((IDropTargetableE4) dropTargetEvent.widget).dragEntered();
30
		}
31
	}
32

    
33
	/** {@inheritDoc} */
34
	@Override
35
    public void dragLeave(DropTargetEvent dropTargetEvent) {
36
		if(dropTargetEvent.widget instanceof Control){
37
			((Control) dropTargetEvent.widget).setBackground(EditorUtil.getColor(Resources.COLOR_COMPOSITE_BACKGROUND));
38
		}
39
	}
40
}
(3-3/4)