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 :

Problème avec les points d'extension


Sujet :

Eclipse Platform

  1. #1
    Membre du Club
    Inscrit en
    Avril 2007
    Messages
    69
    Détails du profil
    Informations forums :
    Inscription : Avril 2007
    Messages : 69
    Points : 48
    Points
    48
    Par défaut Problème avec les points d'extension
    Bonjour a tous,

    Voila j'essai d utiliser un point d'extension dans un plugin pour creer une extension dans un autre :

    voila le .XML du point d'extension
    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    <?xml version='1.0' encoding='UTF-8'?>
    <!-- Schema file written by PDE -->
    <schema targetNamespace="Main">
    <annotation>
          <appInfo>
             <meta.schema plugin="Main" id="idextension" name="nameextension"/>
          </appInfo>
          <documentation>
             [Enter description of this extension point.]
          </documentation>
       </annotation>
     
       <element name="extension">
          <complexType>
             <sequence>
                <element ref="overideview" minOccurs="0" maxOccurs="unbounded"/>
             </sequence>
             <attribute name="point" type="string" use="required">
                <annotation>
                   <documentation>
     
                   </documentation>
                </annotation>
             </attribute>
             <attribute name="id" type="string">
                <annotation>
                   <documentation>
     
                   </documentation>
                </annotation>
             </attribute>
             <attribute name="name" type="string">
                <annotation>
                   <documentation>
     
                   </documentation>
                   <appInfo>
                      <meta.attribute translatable="true"/>
                   </appInfo>
                </annotation>
             </attribute>
          </complexType>
       </element>
     
       <element name="overideview">
          <complexType>
             <attribute name="id_override" type="string" use="required">
                <annotation>
                   <documentation>
     
                   </documentation>
                </annotation>
             </attribute>
             <attribute name="nameoverride" type="string" use="required">
                <annotation>
                   <documentation>
     
                   </documentation>
                </annotation>
             </attribute>
             <attribute name="classe_override" type="string" use="required">
                <annotation>
                   <documentation>
     
                   </documentation>
                   <appInfo>
                      <meta.attribute kind="java" basedOn="main.View:"/>
                   </appInfo>
                </annotation>
             </attribute>
          </complexType>
       </element>
     
       <annotation>
          <appInfo>
             <meta.section type="since"/>
          </appInfo>
          <documentation>
             [Enter the first release in which this extension point appears.]
          </documentation>
       </annotation>
     
       <annotation>
          <appInfo>
             <meta.section type="examples"/>
          </appInfo>
          <documentation>
             [Enter extension point usage example here.]
          </documentation>
       </annotation>
     
       <annotation>
          <appInfo>
             <meta.section type="apiInfo"/>
          </appInfo>
          <documentation>
             [Enter API information here.]
          </documentation>
       </annotation>
     
       <annotation>
          <appInfo>
             <meta.section type="implementation"/>
          </appInfo>
          <documentation>
             [Enter information about supplied implementation of this extension point.]
          </documentation>
       </annotation>
     
       <annotation>
          <appInfo>
             <meta.section type="copyright"/>
          </appInfo>
          <documentation>
     
          </documentation>
       </annotation>
     
    </schema>

    l'extension définie
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    <?xml version="1.0" encoding="UTF-8"?>
    <?eclipse version="3.2"?>
    <plugin>
       <extension
             point="Main.idextension">
          <overideview
                classe_override="extension1.OverrideView"
                id_override="id_extension1"
                nameoverride="name_extension1">
          </overideview>
       </extension>
     
    </plugin>
    le probleme c est que j essais de reperer si un extension est présente avec le code suivant :
    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
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    package main;
     
    import org.eclipse.core.runtime.IExtensionPoint;
    import org.eclipse.core.runtime.Platform;
     
    public abstract class TrackExtension {
     
    	public static boolean getExtension(){
    		boolean res = false; 
     
    		// Récupération de l'extension associée au nom d'horloge
    	      String extensionPointId = "Main.idextension";
    	      IExtensionPoint contributions = 
    	         Platform.getExtensionRegistry().getExtensionPoint(extensionPointId);//.getConfigurationElementsFor(extensionPointId);
     
     
    	      System.out.println("****" + contributions.getContributor().getName());
     
    	      System.out.println("----" + contributions.getExtensions().length);//.getConfigurationElements().length);
     
     
     
    	      //IConfigurationElement extensionview = null;
    	     /*
    	      if (contributions.length == 0) {
    	    	  System.out.println("any extension for current view");
    	      	}
    	      else 
    	    	  System.out.println(contributions.length + "  extension(s) for current view");
    */
     
    	      /*for (int i = 0; i < contributions.length; i++) {
    	         if(contributions[i].getAttribute("name").equals(nomHorlogeCourante)) {
    	        	 extensionview = contributions[i];
    	            break;
    	         }
    	      }
     
    	      // Si une extension est disponible, la classe 'Horloge' correspondante
    	      // est instanciée via la méthode 'createExecutableExtension'
    	      if(extensionHorloge != null) {
    	          try {
    	        	  System.out.println("passes par la");
    	            Horloge horloge = 
    	               (Horloge)extensionHorloge.createExecutableExtension("classe");
    	            horloge.afficher(parent);
    	         } catch (CoreException e) {        	 
    	            String msg = "Impossible d'afficher l'horloge";
    	            System.out.println(msg);
    	            parent.setLayout(new RowLayout());
    	            (new Label(parent, SWT.NONE)).setText(msg);
    	         }*/
    		return res;
    	}
     
    }
    Et je ne comprend pas pourquoi ca ne marche pas (je ne repere aucune extension présente....

    help me please
    merci d avance

  2. #2
    Membre régulier
    Profil pro
    Sr. Software Engineer
    Inscrit en
    Août 2007
    Messages
    169
    Détails du profil
    Informations personnelles :
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Sr. Software Engineer

    Informations forums :
    Inscription : Août 2007
    Messages : 169
    Points : 118
    Points
    118
    Par défaut
    slt,
    en principe le code est bon car visiblement tu t'es inspiré du tuto eclipsetotale. mais puisque ca ne marche je te conseille de bien verifier:

    -- l'id de ton point d'extension (assure toi que l'id dont tu demande les contributeur est bien écrit)

    -- tu peux aussi vérifier ta configuration d'execution afin de savoir si le plug-in contributeur fait effectivement partie de cette configuration.

    j'espère que ce que j'ai dis t'aidera

Discussions similaires

  1. [Lazarus] [Linux] Problème avec les points d'arrêts
    Par ovni76 dans le forum Lazarus
    Réponses: 6
    Dernier message: 15/02/2010, 22h45
  2. problème avec le point d'extension actionSet
    Par henpower dans le forum Eclipse Platform
    Réponses: 1
    Dernier message: 21/05/2008, 09h21
  3. Projet WinCE 5 : Problème avec les points d'arrêts
    Par arnoo91410 dans le forum Visual Studio
    Réponses: 0
    Dernier message: 31/08/2007, 16h11
  4. [TP] Problème avec les points d'arrêt
    Par 8811fred dans le forum Turbo Pascal
    Réponses: 4
    Dernier message: 30/05/2007, 21h17
  5. problème avec les point sprites
    Par conrad dans le forum DirectX
    Réponses: 2
    Dernier message: 14/07/2005, 18h44

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