Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Activator.start method never called

I have implemented some code in the start method in Activator class in purpose to open a wizard right after eclipse will be opened. I'm trying to debug it but the start method is never being called. Any idea what can solve it? Here is Activator code:

public class Activator extends AbstractUIPlugin {

    /**
     * The constructor
     */
    public Activator() {
    }

    public void start(BundleContext context) throws Exception {
        super.start(context);

        // Call function to open a wizard
        openWizard();
    }

    private void openWizard() {

        NewProjectWizard wiz;
        final WizardDialog wd;
        wiz = new NewProjectWizard();
        wd = new WizardDialog(Display.getCurrent().getActiveShell(), wiz);
        Display.getDefault().asyncExec(new Runnable() {
            @Override
            public void run() {
                wd.open();
            }
        });
    }        
}
like image 359
user1016179 Avatar asked Dec 28 '25 20:12

user1016179


1 Answers

You need to configure the Activator on the Overview tab of the plugin.xml editor.

There is also the Activate this plug-in when one of it classes is loaded option, if you specify this then the activator will not be run unless other code references it. If you don't specify this option then your activator will only be started if the run configuration says it should be started. If it is started it may start before the UI code is fully initialized.

All the above means is that the activator is the wrong place to put UI code.

like image 84
greg-449 Avatar answered Dec 30 '25 23:12

greg-449



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!