1 package org.catacomb.druid.swing;
2
3 import org.catacomb.druid.swing.dnd.TextFieldDropTarget;
4 import org.catacomb.interlish.structure.TextDisplayed;
5 import org.catacomb.report.E;
6
7
8
9
10
11 public class DDropTextField extends DTextField {
12 private static final long serialVersionUID = 1L;
13
14
15 TextFieldDropTarget dropTarget;
16
17 Object dropee;
18
19
20 public DDropTextField(String s, int w) {
21 super(s, w);
22
23
24
25
26 getJTextField().setDragEnabled(true);
27 dropTarget = new TextFieldDropTarget(getJTextField(), this);
28
29 }
30
31
32 public void setDropee(Object obj) {
33 dropee = obj;
34 if (dropee instanceof TextDisplayed) {
35 setText(((TextDisplayed)obj).getDisplayText());
36 } else {
37 E.error("need text displayed, not " + obj);
38 }
39 reportAction();
40
41 }
42
43
44
45 public Object getDropee() {
46 return dropee;
47 }
48
49
50
51
52
53 }