3

I have created a sample eclipse plugin development with a button.

@PostConstruct
public void createPartControl(Composite parent) {
    
    Button button = new Button(parent, SWT.PUSH);
    button.setText("button");        
    button.addSelectionListener((SelectionListener) new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            System.out.println(e);
        }
    });
}

I want to initiate eclipse run for a other java file(any other java class) when this button is clicked. Is there any way to programmatically control the run button of the eclipse?

Kaviarasu
  • 58
  • 7
  • 3
    See [Launching a Program](https://help.eclipse.org/2021-09/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fdebug_launch.htm&cp%3D2_0_17_0) in the Eclipse help - this is a complex API. – greg-449 Nov 02 '21 at 12:29
  • 2
    [This article](https://www.eclipse.org/articles/Article-Java-launch/launching-java.html) should also be useful - the example talks about launching Tomcat but most of the article applies to launching other things. – greg-449 Nov 02 '21 at 12:51
  • 1
    Thanks @greg-449. As you said , that example explains about launching Tomcat. I am facing issue because IpluginDescriptor is deprecated. It would be nice if you could share any other handy examples if there are any? – Kaviarasu Nov 05 '21 at 05:42
  • 1
    I don't see any mention of IPluginDescriptor in those links, note that it doesn't exist at all in current Eclipse versions. I don't have any examples. – greg-449 Nov 05 '21 at 07:46
  • 1
    Ok. FYI : IPluginDescriptor is used in the example source code in that article. Anyway Thanks @greg-449. Keep supporting and posting your answers for various questions. Cheers! Looking for any other answers for this post from others! – Kaviarasu Nov 05 '21 at 10:25

0 Answers0