IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Eclipse Platform Discussion :

GEF intercepter le drag and drop de la palette


Sujet :

Eclipse Platform

  1. #1
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Points : 2 336
    Points
    2 336
    Par défaut GEF intercepter le drag and drop de la palette
    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 :

    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();
    	}
    quelqu un aurait une idée de ce que j ai fait de faux ?

  2. #2
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Points : 2 336
    Points
    2 336
    Par défaut
    c'est vraiment bizzard car le FileTransferDropListener marche ... j'ai essayé de remplacé TemplateTransferDropTargetListener par AbstractTransferDropTargetListener mais rien n'y fait cela n'est jamais appeler

  3. #3
    Inactif  
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    2 189
    Détails du profil
    Informations personnelles :
    Âge : 43
    Localisation : Suisse

    Informations forums :
    Inscription : Mai 2006
    Messages : 2 189
    Points : 2 336
    Points
    2 336
    Par défaut
    J ai également tenter de setter le drop listener dans l initialisation du palette viewer sans succès :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    	protected final void initializePaletteViewer() {
    		super.initializePaletteViewer();
    		getPaletteViewer().addDropTargetListener(new PaletteTransferDragAndDropListener(getPaletteViewer()));
    	}

Discussions similaires

  1. Drag and drop "de l'extérieur"
    Par Invité dans le forum C++Builder
    Réponses: 12
    Dernier message: 31/03/2020, 10h10
  2. GEF Drag and drop
    Par zolive dans le forum Eclipse Platform
    Réponses: 0
    Dernier message: 10/09/2007, 10h41
  3. [VB.NET] Microsoft TreeView drag and drop ?
    Par bigtoof dans le forum ASP.NET
    Réponses: 7
    Dernier message: 24/05/2004, 14h50
  4. [JSP][DRAG AND DROP]
    Par hamed dans le forum Servlets/JSP
    Réponses: 7
    Dernier message: 23/01/2004, 17h36
  5. drag and drop
    Par jujuesteban dans le forum Composants VCL
    Réponses: 5
    Dernier message: 20/06/2003, 09h23

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo