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 Java Discussion :

A propos de la vue "VE Model : XMI View" de Visual Editor


Sujet :

Eclipse Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Inscrit en
    Juin 2008
    Messages
    28
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 28
    Par défaut A propos de la vue "VE Model : XMI View" de Visual Editor
    Bonjour à tous,

    J'utilise Visual Editor et je viens de découvrir la vue VE Model : XMI View qui permet d'afficher ma Visual Class java sous forme XML.


    Voici à quoi ressemble ma classe :

    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
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JButton;
    import java.awt.Rectangle;
    import javax.swing.JLabel;
     
    public class Frame extends JFrame {
     
    	private static final long serialVersionUID = 1L;
    	private JPanel jContentPane = null;
    	private JButton jButton = null;
    	private JLabel jLabel = null;
    	/**
             * This is the default constructor
             */
    	public Frame() {
    		super();
    		initialize();
    	}
     
    	/**
             * This method initializes this
             * 
             * @return void
             */
    	private void initialize() {
    		this.setSize(300, 200);
    		this.setContentPane(getJContentPane());
    		this.setTitle("JFrame");
    	}
     
    	/**
             * This method initializes jContentPane
             * 
             * @return javax.swing.JPanel
             */
    	private JPanel getJContentPane() {
    		if (jContentPane == null) {
    			jLabel = new JLabel();
    			jLabel.setBounds(new Rectangle(157, 104, 38, 16));
    			jLabel.setText("JLabel");
    			jContentPane = new JPanel();
    			jContentPane.setLayout(null);
    			jContentPane.add(getJButton(), null);
    			jContentPane.add(jLabel, null);
    		}
    		return jContentPane;
    	}
     
    	/**
             * This method initializes jButton      
             *      
             * @return javax.swing.JButton  
             */
    	private JButton getJButton() {
    		if (jButton == null) {
    			jButton = new JButton();
    			jButton.setBounds(new Rectangle(64, 25, 34, 10));
    		}
    		return jButton;
    	}
     
    }

    Et voici la tête du fichier XML :

    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
      <?xml version="1.0" encoding="UTF-8" ?> 
    - <org.eclipse.ve.internal.jcm:BeanSubclassComposition xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:_-javaprim="java:/" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:java.awt="java:/java.awt" xmlns:java.lang="java:/java.lang" xmlns:javax.swing="java:/javax.swing" xmlns:org.eclipse.jem.internal.instantiation="http:///org/eclipse/jem/internal/instantiation.ecore" xmlns:org.eclipse.ve.internal.cdm="http:///org/eclipse/ve/internal/cdm.ecore" xmlns:org.eclipse.ve.internal.jcm="http:///org/eclipse/ve/internal/jcm.ecore">
      <diagrams id="org.eclipse.ve.internal.cdm.primarydiagram" visualInfos="//@annotations.0/@visualInfos.0 //@annotations.1/@visualInfos.0" /> 
    - <annotations xsi:type="org.eclipse.ve.internal.cdm:AnnotationEMF" annotates="//@members.0">
      <keyedValues xsi:type="ecore:EStringToStringMapEntry" key="org.eclipse.ve.internal.cde.core.nameincomposition" value="jContentPane" /> 
    - <visualInfos diagram="//@diagrams.0">
      <keyedValues xsi:type="org.eclipse.ve.internal.cdm:KeyedBoolean" key="org.eclipse.ve.internal.cdm.model.visualconstraintkey" value="true" /> 
      </visualInfos>
      </annotations>
    - <annotations xsi:type="org.eclipse.ve.internal.cdm:AnnotationEMF" annotates="this">
    - <visualInfos diagram="//@diagrams.0">
      <keyedValues xsi:type="org.eclipse.ve.internal.cdm:KeyedBoolean" key="org.eclipse.ve.internal.cdm.model.visualconstraintkey" value="true" /> 
      </visualInfos>
      </annotations>
    + <annotations xsi:type="org.eclipse.ve.internal.cdm:AnnotationEMF" annotates="//@members.1">
      <keyedValues xsi:type="ecore:EStringToStringMapEntry" key="org.eclipse.ve.internal.cde.core.nameincomposition" value="jButton" /> 
      </annotations>
    - <annotations xsi:type="org.eclipse.ve.internal.cdm:AnnotationEMF" annotates="//@members.2">
      <keyedValues xsi:type="ecore:EStringToStringMapEntry" key="org.eclipse.ve.internal.cde.core.nameincomposition" value="jLabel" /> 
      </annotations>
    - <members xsi:type="javax.swing:JPanel">
    - <allocation xsi:type="org.eclipse.jem.internal.instantiation:ParseTreeAllocation">
      <expression xsi:type="org.eclipse.jem.internal.instantiation:PTClassInstanceCreation" type="javax.swing.JPanel" /> 
      </allocation>
      <layout xsi:nil="true" /> 
    - <components component="//@members.1">
      <constraint xsi:nil="true" /> 
      </components>
    - <components component="//@members.2">
      <constraint xsi:nil="true" /> 
      </components>
      </members>
      <members xsi:type="javax.swing:JButton" bounds="//@methods.2/@properties.0" /> 
      <members xsi:type="javax.swing:JLabel" bounds="//@methods.0/@properties.1" text="//@methods.0/@properties.0" /> 
      <thisPart xsi:type="_-javaprim:Frame" xmi:id="this" size="//@methods.1/@properties.0" title="//@methods.1/@properties.1" contentPane="//@members.0" /> 
    - <methods name="getJContentPane" initializes="//@members.0 //@members.2" return="//@members.0">
    - <properties xsi:type="java.lang:String">
      <allocation xsi:type="org.eclipse.jem.internal.instantiation:InitStringAllocation" initString=""JLabel"" /> 
      </properties>
    - <properties xsi:type="java.awt:Rectangle">
    - <allocation xsi:type="org.eclipse.jem.internal.instantiation:ParseTreeAllocation">
    - <expression xsi:type="org.eclipse.jem.internal.instantiation:PTClassInstanceCreation" type="java.awt.Rectangle">
      <arguments xsi:type="org.eclipse.jem.internal.instantiation:PTNumberLiteral" token="157" /> 
      <arguments xsi:type="org.eclipse.jem.internal.instantiation:PTNumberLiteral" token="104" /> 
      <arguments xsi:type="org.eclipse.jem.internal.instantiation:PTNumberLiteral" token="38" /> 
      <arguments xsi:type="org.eclipse.jem.internal.instantiation:PTNumberLiteral" token="16" /> 
      </expression>
      </allocation>
      </properties>
      </methods>
    - <methods name="initialize" initializes="this">
    - <properties xsi:type="java.awt:Dimension">
      <allocation xsi:type="org.eclipse.jem.internal.instantiation:InitStringAllocation" initString="new java.awt.Dimension(300,200)" /> 
      </properties>
    - <properties xsi:type="java.lang:String">
    - <allocation xsi:type="org.eclipse.jem.internal.instantiation:ParseTreeAllocation">
      <expression xsi:type="org.eclipse.jem.internal.instantiation:PTStringLiteral" escapedValue=""JFrame"" /> 
      </allocation>
      </properties>
      </methods>
    - <methods name="getJButton" initializes="//@members.1" return="//@members.1">
    - <properties xsi:type="java.awt:Rectangle">
    - <allocation xsi:type="org.eclipse.jem.internal.instantiation:ParseTreeAllocation">
    - <expression xsi:type="org.eclipse.jem.internal.instantiation:PTClassInstanceCreation" type="java.awt.Rectangle">
      <arguments xsi:type="org.eclipse.jem.internal.instantiation:PTNumberLiteral" token="64" /> 
      <arguments xsi:type="org.eclipse.jem.internal.instantiation:PTNumberLiteral" token="25" /> 
      <arguments xsi:type="org.eclipse.jem.internal.instantiation:PTNumberLiteral" token="34" /> 
      <arguments xsi:type="org.eclipse.jem.internal.instantiation:PTNumberLiteral" token="10" /> 
      </expression>
      </allocation>
      </properties>
      </methods>
      </org.eclipse.ve.internal.jcm:BeanSubclassComposition>

    Ce que je souhaiterais, c'est que Visual Editor puisse, à partir d'un fichier XML (valide bien sûr) comme celui ci-dessus, reconstruire ma classe java et afficher son aperçu dans la fenêtre d'édition.

    Donc je me demandais si VE serait capable de parser ce fichier pour reconstruire une classe ou alors si il existerait d'autres méthodes pour le faire.


    Merci d'avance pour l'aide que vous pourrez m'apporter.

    Nicolas.

  2. #2
    Membre averti
    Homme Profil pro
    programmeur / analyste
    Inscrit en
    Novembre 2003
    Messages
    41
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 51
    Localisation : Canada

    Informations professionnelles :
    Activité : programmeur / analyste
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Novembre 2003
    Messages : 41
    Par défaut
    Je ne sais pas si c'est ce que tu recherche mais, jette un coup d'œil là dessus: http://www.castor.org/. Pour ma par, je ne l'ai jamais vraiment utilisé.

    Cheers,

    mr. Bungle

  3. #3
    Membre averti
    Inscrit en
    Juin 2008
    Messages
    28
    Détails du profil
    Informations forums :
    Inscription : Juin 2008
    Messages : 28
    Par défaut
    Je te remercie, je vais regarder ça !

Discussions similaires

  1. Mise à jour de la vue lorsque le model est modifié
    Par kespy13 dans le forum AngularJS
    Réponses: 11
    Dernier message: 02/04/2015, 13h57
  2. [Débutant] passage resultat requete a une vue avec ViewData.Model
    Par userparis dans le forum ASP.NET MVC
    Réponses: 2
    Dernier message: 05/11/2014, 13h38
  3. QGIS : lenteur pour afficher les listes des vues dans &quot;Ajouter une table PostGIS&quot;
    Par fafa63 dans le forum SIG : Système d'information Géographique
    Réponses: 2
    Dernier message: 11/07/2014, 19h04
  4. Hibernate tools - activer vue Hibernate entity model
    Par hugo123 dans le forum Hibernate
    Réponses: 2
    Dernier message: 12/12/2006, 13h31

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