Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpperret2009-05-17 12:11:20 -0400
committerpperret2009-05-17 12:11:20 -0400
commitd53f190057e96dc6f44cf66eceeb7db8fd46ef9f (patch)
tree10a5b3bec1b7923374ccf76ebee80f61a1961602 /examples
parent8a74a991e3f8a0cdcd9b2d86d6e42236e5fa3d1c (diff)
downloadorg.eclipse.ecf-d53f190057e96dc6f44cf66eceeb7db8fd46ef9f.tar.gz
org.eclipse.ecf-d53f190057e96dc6f44cf66eceeb7db8fd46ef9f.tar.xz
org.eclipse.ecf-d53f190057e96dc6f44cf66eceeb7db8fd46ef9f.zip
Twitter client application for TwitterHub
Diffstat (limited to 'examples')
-rw-r--r--examples/bundles/org.eclipse.ecf.example.twitter.client/.project28
-rw-r--r--examples/bundles/org.eclipse.ecf.example.twitter.client/META-INF/MANIFEST.MF17
-rw-r--r--examples/bundles/org.eclipse.ecf.example.twitter.client/plugin.xml49
-rw-r--r--examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/Activator.java25
-rw-r--r--examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/Application.java77
-rw-r--r--examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/IStartApp.java9
6 files changed, 205 insertions, 0 deletions
diff --git a/examples/bundles/org.eclipse.ecf.example.twitter.client/.project b/examples/bundles/org.eclipse.ecf.example.twitter.client/.project
new file mode 100644
index 000000000..af8347223
--- /dev/null
+++ b/examples/bundles/org.eclipse.ecf.example.twitter.client/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.ecf.twitter.client</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/bundles/org.eclipse.ecf.example.twitter.client/META-INF/MANIFEST.MF b/examples/bundles/org.eclipse.ecf.example.twitter.client/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..32a83aa77
--- /dev/null
+++ b/examples/bundles/org.eclipse.ecf.example.twitter.client/META-INF/MANIFEST.MF
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Client
+Bundle-SymbolicName: org.eclipse.ecf.twitter.client;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.eclipse.ecf.twitter.client.Activator
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.osgi.framework;version="1.3.0"
+Require-Bundle: org.eclipse.ecf.ui;bundle-version="2.1.0",
+ org.eclipse.ui;bundle-version="3.5.0",
+ org.eclipse.equinox.app;bundle-version="1.2.0",
+ org.eclipse.ecf;bundle-version="3.0.0",
+ org.eclipse.core.runtime;bundle-version="3.5.0",
+ org.eclipse.ecf.provider;bundle-version="2.0.0",
+ org.eclipse.ecf.provider.twitter.ui.hub;bundle-version="1.0.0",
+ org.eclipse.ecf.provider.twitter;bundle-version="1.0.0"
diff --git a/examples/bundles/org.eclipse.ecf.example.twitter.client/plugin.xml b/examples/bundles/org.eclipse.ecf.example.twitter.client/plugin.xml
new file mode 100644
index 000000000..edb9f89f4
--- /dev/null
+++ b/examples/bundles/org.eclipse.ecf.example.twitter.client/plugin.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ id="org.eclipse.ecf.twitter.client.id1"
+ point="org.eclipse.core.runtime.applications">
+ <application
+ cardinality="singleton-global"
+ thread="main"
+ visible="true">
+ <run
+ class="org.eclipse.ecf.twitter.client.Application">
+ </run>
+ </application>
+ </extension>
+ <extension
+ id="ecf.twitter.client"
+ name="TwitterClient"
+ point="org.eclipse.ecf.containerFactory">
+ <containerFactory
+ class="org.eclipse.ecf.provider.generic.GenericContainerInstantiator"
+ name="TwitterClientContainerInstantiator">
+ </containerFactory>
+ </extension>
+ <extension
+ point="org.eclipse.ui.actionSets">
+ <actionSet
+ id="org.eclipse.ecf.twitter.client.actionSet1"
+ label="Twitter actions"
+ visible="true">
+ <action
+ definitionId="org.eclipse.ecf.discovery.ui.browser.command.open"
+ id="org.eclipse.ecf.twitter.client.action.HelloTwitter"
+ label="Hello Twitter !"
+ style="push">
+ </action>
+ </actionSet>
+ </extension>
+ <extension
+ point="org.eclipse.ecf.ui.connectWizards">
+ <wizard
+ class="org.eclipse.ecf.internal.provider.twitter.ui.wizards.TwitterConnectWizard"
+ containerFactoryName="org.eclipse.ecf.twitter.client.wizard1"
+ id="org.eclipse.ecf.twitter.client.TwitterClient"
+ name="TwitterClient">
+ </wizard>
+ </extension>
+
+</plugin>
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
new file mode 100644
index 000000000..31a8b44b9
--- /dev/null
+++ b/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/Activator.java
@@ -0,0 +1,25 @@
+package org.eclipse.ecf.twitter.client;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class Activator implements BundleActivator {
+
+ private IStatus status;
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ }
+
+}
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
new file mode 100644
index 000000000..bb1a86e28
--- /dev/null
+++ b/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/Application.java
@@ -0,0 +1,77 @@
+package org.eclipse.ecf.twitter.client;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.ecf.core.ContainerCreateException;
+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.provider.twitter.container.TwitterInstantiator;
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog;
+
+@SuppressWarnings("restriction")
+public class Application implements IApplication, IECFStart, IStartApp {
+
+ private IStatus status;
+
+ IApplicationContext context;
+ private final static String containerName = "ecf.twitter.client";
+ private IContainer container;
+
+ @Override
+ public Object start(IApplicationContext context) throws Exception {
+ this.context = context;
+ IProgressMonitor pgm= (IProgressMonitor) new ProgressMonitorJobsDialog(
+ Display.getDefault().getActiveShell());
+ run( pgm );
+ return MultiStatus.OK_STATUS;
+ }
+
+ @Override
+ public void stop() {
+
+ }
+
+ public IContainer createClient() throws ContainerCreateException {
+ return ContainerFactory.getDefault()
+ .createContainer( new ContainerTypeDescription(
+ containerName, TwitterInstantiator.class.getName() ,
+ "Trivial client/container for TwitterHub"));
+ }
+
+ protected static String getContainername() {
+ return containerName;
+ }
+
+ @Override
+ public IStatus run(IProgressMonitor monitor) {
+ try {
+ setContainer(this.createClient());
+ } catch (ContainerCreateException e) {
+ // TODO Auto-generated catch block
+ try {
+ throw new Exception();
+ } catch (Exception e1) {
+ // TODO Auto-generated catch block
+
+ }
+ }
+
+ return MultiStatus.OK_STATUS;
+ }
+
+ public void setContainer(IContainer container) {
+ this.container = container;
+ }
+
+ public IContainer getContainer() {
+ return container;
+ }
+
+
+}
diff --git a/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/IStartApp.java b/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/IStartApp.java
new file mode 100644
index 000000000..67da1e2cd
--- /dev/null
+++ b/examples/bundles/org.eclipse.ecf.example.twitter.client/src/org/eclipse/ecf/twitter/client/IStartApp.java
@@ -0,0 +1,9 @@
+package org.eclipse.ecf.twitter.client;
+
+import org.eclipse.ecf.core.ContainerCreateException;
+import org.eclipse.ecf.core.IContainer;
+
+public interface IStartApp {
+
+ public IContainer createClient() throws ContainerCreateException;
+}

Back to the top