1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package pl.edu.agh.cast.ui.outline.dnd;
19
20 import org.eclipse.swt.dnd.Transfer;
21 import org.eclipse.swt.dnd.TransferData;
22
23
24
25
26
27
28 public final class ModelElementTransfer extends Transfer {
29
30 private static ModelElementTransfer instance;
31
32 private static final String TYPE_NAME = ModelElementTransfer.class.getName();
33
34 private static final int TYPEID = registerType(TYPE_NAME);
35
36
37
38
39
40
41 public static synchronized ModelElementTransfer getInstance() {
42 if (instance == null) {
43 instance = new ModelElementTransfer();
44 }
45 return instance;
46 }
47
48
49
50
51
52
53 @Override
54 public TransferData[] getSupportedTypes() {
55 return new TransferData[0];
56 }
57
58
59
60
61
62
63 @Override
64 protected int[] getTypeIds() {
65 return new int[] { TYPEID };
66 }
67
68
69
70
71
72
73 @Override
74 protected String[] getTypeNames() {
75 return new String[] { TYPE_NAME };
76 }
77
78
79
80
81
82
83 @Override
84 public boolean isSupportedType(TransferData transferData) {
85 return true;
86 }
87
88
89
90
91
92
93 @Override
94 protected void javaToNative(Object object, TransferData transferData) {
95 throw new UnsupportedOperationException("NYI");
96 }
97
98
99
100
101
102
103 @Override
104 protected Object nativeToJava(TransferData transferData) {
105 throw new UnsupportedOperationException("NYI");
106 }
107
108 }