Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-19-2008, 07:01 PM
Member
 
Join Date: Nov 2008
Posts: 2
Rep Power: 0
KingAndrew is on a distinguished road
Default Why is my Plugin Activator not being started?
Hi All,
I have an rcp. It has 2 plugins. One core and one ui. The activator for the ui is not getting called. The activator is:
Code:
Plugin extends AbstractUIPlugin
...
	public void start(BundleContext context) throws Exception {
		super.start(context);
		plugin = this;
	}
And in the MANIFEST.MF it has:
Code:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ui Plug-in
Bundle-SymbolicName: com.myco.omni.adminsuite.ui; singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: com.myco.omni.adminsuite.ui.Plugin
Bundle-Vendor: myco
Require-Bundle: org.eclipse.ui,
 org.eclipse.ui.intro;bundle-version="3.2.201",
 org.eclipse.ui.console;bundle-version="3.3.0",
 org.eclipse.ui.forms;bundle-version="3.3.101",
 org.eclipse.ui.browser;bundle-version="3.2.201",
 org.eclipse.core.resources,
 org.eclipse.core.runtime,
 com.myco.omni.adminsuite;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
When I am in on of my Views I call Plugin.getDefault(); and it returns null so clearly the start method has not been called.

Does anyone see what I'm not doing that I should be?

Thanks in advance,

Andrew
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 11-19-2008, 09:07 PM
Member
 
Join Date: Nov 2008
Posts: 2
Rep Power: 0
KingAndrew is on a distinguished road
Exclamation
Talk about the weirdest thing. I still don't know why it wasn't calling/activating my plug-in so I decided to do it myself
Code:
Plugin plugin = Plugin.getDefault();
			if(null == plugin){
				plugin = activatePlugin(Plugin.PLUGIN_ID);
			}
...snip...

private Plugin activatePlugin(String pluginID) {
		Bundle bundle = Platform.getBundle(pluginID);
		try {
			bundle.start();
		} catch (BundleException e) {
			// Auto-generated catch block
			e.printStackTrace();
		}
		
		Application.writeToConsole("The Plug-in "+pluginID+" : "+bundle.getState());
		return Plugin.getDefault();
	}
So that got it to load my plug-in. Hurray!!

So I think I'll move that method somewhere that others can use it and while I'm trying it in the debugger from a fresh re-start of the application it does not get called but the start method on the plug-in is getting called like it should of from the start.

So it seems like the plug-in registry has learned that it is supposed to load that plug-in now.

Hope this helps someone else one day,

Andrew
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP Getting Started. sukatoa JavaServer Pages (JSP) and JSTL 7 07-21-2008 03:08 AM
How do I get started? programmer-in-training New To Java 4 01-11-2008 08:45 AM
Getting Started Doorsmaniac Java Applets 0 11-24-2007 04:40 AM
I need help getting started Android New To Java 2 10-30-2007 05:46 PM
AnyEdit Plugin For Eclipse Plugin JavaForums Eclipse 0 05-18-2007 01:28 PM


All times are GMT +2. The time now is 11:03 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org