Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Override the IDEApplication?
Override the IDEApplication? [message #755954] Thu, 10 November 2011 10:14 Go to next message
js Missing name is currently offline js Missing nameFriend
Messages: 73
Registered: July 2009
Member
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 13:12 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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 17:31 Go to previous message
Erick Fonseca is currently offline Erick FonsecaFriend
Messages: 68
Registered: December 2011
Member
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: Tue Mar 19 11:31:02 GMT 2024

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

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

Back to the top