Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 369657

Summary: FormsPlugin (Activator) unnecessary extends AbstractUIPlugin
Product: [Eclipse Project] Platform Reporter: Tom K. <spam>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: bugs.eclipse.org, Lars.Vogel, pwebster, remy.suen
Version: 4.2Keywords: helpwanted
Target Milestone: 4.3 M7   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
simplify FormsPlugin none

Description Tom K. CLA 2012-01-25 08:25:15 EST
Build Identifier: I20120103-1230

The plugin org.eclipse.ui.forms has an optional dependency on org.eclipse.ui.
This is great since because of that you can use for e4 rcp clients the most of the forms api without depending on org.eclipse.ui

But... Since the activator (org.eclipse.ui.internal.forms.FormsPlugin) is extedning AbstractUIPlugin the declared optional dependency gets an implicit required dependency.

Proposal: Rewrite org.eclipse.ui.internal.forms.FormsPlugin to implements BundleActivator instead of extending AbstractUIPlugin.


-------------------------------------------------------------
package org.eclipse.ui.internal.forms;

import org.eclipse.ui.internal.forms.widgets.FormsResources;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;


public class FormsPlugin implements BundleActivator {

    private static BundleContext context;

    static BundleContext getContext() {
        return context;
    }
	
  
    public void start(BundleContext context) throws Exception {
        FormsPlugin.context = context;

    }
    
    public void stop(BundleContext context) throws Exception {         
        FormsResources.shutdown();
        FormsPlugin.context = null;
    }

}
-------------------------------------------------------------

Reproducible: Always
Comment 1 Tom K. CLA 2012-06-05 07:32:51 EDT
Can we get somebody checking this ? Would be great...
Comment 2 Paul Webster CLA 2012-06-05 08:12:44 EDT
Created attachment 216822 [details]
simplify FormsPlugin
Comment 3 Remy Suen CLA 2012-06-05 08:20:24 EDT
(In reply to comment #2)
> Created attachment 216822 [details]
> simplify FormsPlugin

Is that getContext() method actually needed?
Comment 4 Paul Webster CLA 2012-06-05 08:22:44 EDT
I suspect not ... I'll remove it when we look at this in 4.3 and if it still compiles ... ta da!

PW
Comment 5 Lars Vogel CLA 2013-03-25 04:50:12 EDT
Is this something we want to do for Eclipse 4.3?
Comment 6 Paul Webster CLA 2013-03-25 06:05:44 EDT
I won't have time to look at it, but if you want to test it out and submit a Gerrit change we can pull it in.

PW
Comment 7 Markus Kuppe CLA 2013-03-25 08:21:44 EDT
https://git.eclipse.org/r/#/c/11423/ has Paul's patch + Remy's suggestion to remove getContext()
Comment 8 Markus Kuppe CLA 2013-03-26 16:29:59 EDT
As per Brian de Alwis request...

1. I have authored 100% of the content I'm contributing

Yes (see my comment #7)

2. I have the rights to donate the content to Eclipse

Yes

3. I contribute the content under the EPL

Yes
Comment 10 Paul Webster CLA 2013-05-17 10:47:53 EDT
In 4.3.0.I20130516-2200

PW