diff options
author | pperret | 2009-05-17 20:42:11 +0000 |
---|---|---|
committer | pperret | 2009-05-17 20:42:11 +0000 |
commit | b5cb26a60af8e5da2150b3f4fdc7f3a3a18e230d (patch) | |
tree | e4270261fc1b8993f8463f3e9a7956b276a2e84e | |
parent | d53f190057e96dc6f44cf66eceeb7db8fd46ef9f (diff) | |
download | org.eclipse.ecf-b5cb26a60af8e5da2150b3f4fdc7f3a3a18e230d.tar.gz org.eclipse.ecf-b5cb26a60af8e5da2150b3f4fdc7f3a3a18e230d.tar.xz org.eclipse.ecf-b5cb26a60af8e5da2150b3f4fdc7f3a3a18e230d.zip |
+Activator
4 files changed, 64 insertions, 16 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.twitter.client/plugin.xml b/examples/bundles/org.eclipse.ecf.example.twitter.client/plugin.xml index edb9f89f4..f6fa70fb7 100644 --- a/examples/bundles/org.eclipse.ecf.example.twitter.client/plugin.xml +++ b/examples/bundles/org.eclipse.ecf.example.twitter.client/plugin.xml @@ -29,6 +29,7 @@ label="Twitter actions" visible="true"> <action + class="connectaction" definitionId="org.eclipse.ecf.discovery.ui.browser.command.open" id="org.eclipse.ecf.twitter.client.action.HelloTwitter" label="Hello Twitter !" diff --git a/examples/bundles/org.eclipse.ecf.example.twitter.client/src/ConnectAction.java b/examples/bundles/org.eclipse.ecf.example.twitter.client/src/ConnectAction.java new file mode 100644 index 000000000..67574cfda --- /dev/null +++ b/examples/bundles/org.eclipse.ecf.example.twitter.client/src/ConnectAction.java @@ -0,0 +1,33 @@ +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; + + +public class ConnectAction implements IWorkbenchWindowActionDelegate { + + @Override + public void dispose() { + // TODO Auto-generated method stub + + } + + @Override + public void init(IWorkbenchWindow window) { + // TODO Auto-generated method stub + + } + + @Override + public void run(IAction action) { + // TODO Auto-generated method stub + + } + + @Override + public void selectionChanged(IAction action, ISelection selection) { + // TODO Auto-generated method stub + + } + +} diff --git a/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/Activator.java b/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/Activator.java index 31a8b44b9..0fda8f6f0 100644 --- a/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/Activator.java +++ b/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/Activator.java @@ -1,25 +1,44 @@ package org.eclipse.ecf.twitter.client; import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; +import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; -public class Activator implements BundleActivator { +public class Activator extends AbstractUIPlugin implements BundleActivator { private IStatus status; - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.ecf.provider.twitter.ui"; + + // The shared instance + private static Activator plugin; + + /** + * The constructor */ + public Activator() { + } + + @Override public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; } - /* - * (non-Javadoc) - * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) - */ + @Override public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; } } diff --git a/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/Application.java b/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/Application.java index bb1a86e28..543999283 100644 --- a/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/Application.java +++ b/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/Application.java @@ -8,6 +8,7 @@ import org.eclipse.ecf.core.ContainerFactory; import org.eclipse.ecf.core.ContainerTypeDescription; import org.eclipse.ecf.core.IContainer; import org.eclipse.ecf.core.start.IECFStart; +import org.eclipse.ecf.core.util.Trace; import org.eclipse.ecf.provider.twitter.container.TwitterInstantiator; import org.eclipse.equinox.app.IApplication; import org.eclipse.equinox.app.IApplicationContext; @@ -53,13 +54,7 @@ public class Application implements IApplication, IECFStart, IStartApp { try { setContainer(this.createClient()); } catch (ContainerCreateException e) { - // TODO Auto-generated catch block - try { - throw new Exception(); - } catch (Exception e1) { - // TODO Auto-generated catch block - - } + Trace.trace( Activator.PLUGIN_ID, "ContainerCreateException" ); } return MultiStatus.OK_STATUS; |