Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Override the IDEApplication?
Override the IDEApplication? [message #755954] Thu, 10 November 2011 05:14 Go to next message
Eclipse UserFriend
I have created a product configuration that use the

org.eclipse.ui.ide.workbench 


application which refers to the

org.eclipse.ui.internal.ide.application.IDEApplication


class. Now I would like to override parts of this implementation so I have created:




import org.eclipse.ui.internal.ide.application.IDEApplication;

public class MyApplication extends IDEApplication {
  /*
   * (non-Javadoc)
   * 
   * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.
   * IApplicationContext)
   */
  public Application() {
    super();
  }

}


But most of the code I want to override is located in the Advisor classes (Window, bar etc) which are "hardwired" inside the start method of the IDEApplication:

    /* (non-Javadoc)
     * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext context)
     */
    public Object start(IApplicationContext appContext) throws Exception {
...
            int returnCode = PlatformUI.createAndRunWorkbench(display,
            		new IDEWorkbenchAdvisor(processor));
...


I could copy/paste all the code from the super start method and then replace with my own Advisor classes but it s not nice to maintain and there a also some visibility issues (meaning I need to copy more source files).

Are there any recommended approach to overriding eclipse build in application, eg. using extension points to delegate Advisors used to custom classes?
Re: Override the IDEApplication? [message #756009 is a reply to message #755954] Thu, 10 November 2011 08:12 Go to previous messageGo to next message
Eclipse UserFriend
The IApplication class sets up the advisors, and the advisors are how you customize/extend an RCP app.

If you want an RCP app that behaves differently you must provide the complete set of WorkbenchAdvisor/WorkbenchWindowAdvisors yourself. You will have to copy out the code if you want an app that works almost the same as the default IDE app.

PW
Re: Override the IDEApplication? [message #1073401 is a reply to message #756009] Wed, 24 July 2013 13:31 Go to previous message
Eclipse UserFriend
This thread is old by I run into exactly the same problem.
I tried to extend the IDEApplication class and copy its start method, but I got a ton of warnings about discouraged access.

Isn't there a better way now to do it if I only need to replace the WorkbenchAdvisor?
Previous Topic:how to add "move project action" to custom cnf
Next Topic:how to get main actionbar in CommonActionProvider
Goto Forum:
  


Current Time: Fri Mar 28 06:35:01 EDT 2025

Powered by FUDForum. Page generated in 0.04363 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top