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 :

[Eclipse RCP] org.eclipse.equinox.app.IApplication#stop() jamais appelé?


Sujet :

Eclipse Platform

  1. #1
    Membre expérimenté
    Avatar de azerr
    Homme Profil pro
    Ingénieur Etude JEE/Eclipse RCP
    Inscrit en
    Avril 2006
    Messages
    942
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Drôme (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur Etude JEE/Eclipse RCP
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Avril 2006
    Messages : 942
    Points : 1 464
    Points
    1 464
    Par défaut [Eclipse RCP] org.eclipse.equinox.app.IApplication#stop() jamais appelé?
    Bonjour,

    J'ai généré une application RCP basique avec PDE qui m'a genere une classe Application qui implémente org.eclipse.equinox.app.IApplication :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
     
    public class Application implements IApplication {
     
    	public Object start(IApplicationContext context) {
    ...	}
     
    	public void stop() {
           }
    }
    Lorsque je mets un point d'arrêt dans la méthode start, je m'arrête bien dedans, alors que quand je mets un point d'arrêt dans le méthode stop je n'y passe jamais (que je stoppe le bundle ou que je ferme l'application RCP avec X ou que je stoppe la console OSGi)?

    A quoi sert cette méthode si celle-ci n'est jamais appelé? Comment l'appeler?

    Merci de votre aide.

    Angelo

  2. #2
    Membre expérimenté
    Avatar de azerr
    Homme Profil pro
    Ingénieur Etude JEE/Eclipse RCP
    Inscrit en
    Avril 2006
    Messages
    942
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Drôme (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur Etude JEE/Eclipse RCP
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Avril 2006
    Messages : 942
    Points : 1 464
    Points
    1 464
    Par défaut
    Il faut que je me réveille ce matin. Tout est marque dans la JavaDoc de IApplicationContext :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    /**
     * Forces this running application to exit.  This method should wait until the
     * running application is ready to exit.  The {@link #start(IApplicationContext)}
     * should already have exited or should exit very soon after this method exits<p>
     *
     * This method is only called to force an application to exit.
     * This method will not be called if an application exits normally from
     * the {@link #start(IApplicationContext)} method.
     * <p>
     * Note: This method is called by the platform; it is not intended
     * to be called directly by clients.
     * </p>
     */
    public void stop();
    Autrement dit, si l'application se termine normalement en fermant la fenêtre par exemple, cette méthode N'est PAS appelée.

    Angelo

  3. #3
    Membre expérimenté
    Avatar de azerr
    Homme Profil pro
    Ingénieur Etude JEE/Eclipse RCP
    Inscrit en
    Avril 2006
    Messages
    942
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 47
    Localisation : France, Drôme (Rhône Alpes)

    Informations professionnelles :
    Activité : Ingénieur Etude JEE/Eclipse RCP
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Avril 2006
    Messages : 942
    Points : 1 464
    Points
    1 464
    Par défaut
    Par contre je ne sais pas ce que signifie "application exits normally".

    voici le code de la méthode start de ma classe Applicartion générée :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    	public Object start(IApplicationContext context) {
    		Display display = PlatformUI.createDisplay();
    		try {
    			int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
    			if (returnCode == PlatformUI.RETURN_RESTART) {
    				return IApplication.EXIT_RESTART;
    			}
    			return IApplication.EXIT_OK;
    		} finally {
    			display.dispose();
    		}
    	}
    J'ai tenté de retourner une autre valeur que IApplication.EXIT_OK ou encore lancer une RuntimeException. la méthode stop n'est jamais appelé.

Discussions similaires

  1. Eclipse RCP et Eclipse IDE
    Par cafcas69 dans le forum Eclipse Platform
    Réponses: 2
    Dernier message: 04/06/2013, 22h44
  2. import org. eclipse. equinox.app.IApplication;
    Par jonathan06021985 dans le forum Eclipse Platform
    Réponses: 2
    Dernier message: 28/01/2008, 14h03
  3. org. eclipse. equinox.app.IApplication
    Par jonathan06021985 dans le forum Eclipse Java
    Réponses: 1
    Dernier message: 24/01/2008, 07h38
  4. [Eclipse RCP org.eclipse.ui.forms]Erreur au lancement
    Par tatemilio2 dans le forum SWT/JFace
    Réponses: 1
    Dernier message: 12/03/2007, 20h54
  5. spring RCP ou eclipse RCP
    Par noussa1982 dans le forum Eclipse Platform
    Réponses: 3
    Dernier message: 22/01/2007, 11h22

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