Salut,
Je cherche dans mon application a créer un wizard lorsque un utilisateur drag and drop un palette item.
J'ai essayé de créer une classe qui étend TemplateTransferDropTargetListener et placé un breakpoint dans la méthode handleDrop mais elle semble n'être jamais appeller.
J'enregistre le listener de cette manière dans l'editeur :
quelqu un aurait une idée de ce que j ai fait de faux ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 /** * Initialize the GraphicalViewer after it has been created. */ protected void initializeGraphicalViewer() { getGraphicalViewer().setContents(getRootWidget()); // Enable drag-and-drop from the palette PaletteTransferDropTargetListener tc = new PaletteTransferDropTargetListener ( getGraphicalViewer()) { protected CreationFactory getFactory(Object template) { return new WidgetCreationFactory((WidgetTemplate) template); } }; getGraphicalViewer().addDropTargetListener(tc); // Enable drap-and-drop of resources from the Navigator FileTransferDropListener rt = new FileTransferDropListener( getGraphicalViewer()); getGraphicalViewer().addDropTargetListener(rt); /** * Create a KeyBindingService. If we do not do this then when the * DesignEditor is used in a MultiPartEditor the other editors key * services may be used instead. * This causes problems. For example the KeyBinding for the delete * method no longer works in the DesignEditor after using a TextEditor. */ getSite().getKeyBindingService(); }
Partager