Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2009-03-16 15:00:07 -0400
committerSusan Franklin2009-03-16 15:00:07 -0400
commit5d0fe37c3b02d0c6692f5065ec3f2373bb930305 (patch)
treebef0b5a9225c6797ee3ef985910f535687f8ffb1 /examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates
parente2be79e71807bc0f7b9d26a87e3dcb1244014f5e (diff)
downloadrt.equinox.p2-5d0fe37c3b02d0c6692f5065ec3f2373bb930305.tar.gz
rt.equinox.p2-5d0fe37c3b02d0c6692f5065ec3f2373bb930305.tar.xz
rt.equinox.p2-5d0fe37c3b02d0c6692f5065ec3f2373bb930305.zip
initial content
Diffstat (limited to 'examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates')
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.classpath7
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.project28
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/META-INF/MANIFEST.MF27
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/build.properties8
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/mail.icobin0 -> 26694 bytes
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.gifbin0 -> 983 bytes
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.icnsbin0 -> 35301 bytes
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample2.gifbin0 -> 318 bytes
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample3.gifbin0 -> 173 bytes
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/plugin.xml97
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/product_lg.gifbin0 -> 9559 bytes
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/splash.bmpbin0 -> 135600 bytes
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Activator.java61
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Application.java45
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationActionBarAdvisor.java108
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchAdvisor.java21
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchWindowAdvisor.java29
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ICommandIds.java15
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/MessagePopupAction.java25
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/NavigationView.java151
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/OpenViewAction.java36
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Perspective.java25
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/View.java77
24 files changed, 768 insertions, 0 deletions
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.classpath b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.classpath
new file mode 100644
index 000000000..64c5e31b7
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.project b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.project
new file mode 100644
index 000000000..ca9f8bc17
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates</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/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..1fe1140c0
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Mon Mar 16 11:53:51 PDT 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/META-INF/MANIFEST.MF b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..8ed6b3cc2
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/META-INF/MANIFEST.MF
@@ -0,0 +1,27 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Sdknoautoupdates
+Bundle-SymbolicName: org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates; singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.Activator
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.equinox.p2.ui;bundle-version="1.0.100",
+ org.eclipse.equinox.p2.metadata;bundle-version="1.0.0",
+ org.eclipse.equinox.p2.metadata.repository;bundle-version="1.0.0",
+ org.eclipse.equinox.p2.artifact.repository;bundle-version="1.0.0",
+ org.eclipse.equinox.p2.extensionlocation;bundle-version="1.0.0",
+ org.eclipse.equinox.p2.updatesite;bundle-version="1.0.0",
+ org.eclipse.equinox.p2.director;bundle-version="1.0.100",
+ org.eclipse.equinox.p2.engine;bundle-version="1.0.100",
+ org.eclipse.equinox.p2.core;bundle-version="1.0.100",
+ org.eclipse.ecf;bundle-version="3.0.0",
+ org.eclipse.ecf.filetransfer;bundle-version="3.0.0",
+ org.eclipse.ecf.identity;bundle-version="3.0.0",
+ org.eclipse.ecf.provider.filetransfer;bundle-version="3.0.0",
+ org.eclipse.ecf.provider.filetransfer.httpclient;bundle-version="3.0.0",
+ org.apache.commons.codec;bundle-version="1.3.0",
+ org.apache.commons.httpclient;bundle-version="3.1.0",
+ org.eclipse.equinox.p2.ui.sdk;bundle-version="1.0.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/build.properties b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/build.properties
new file mode 100644
index 000000000..4b6aaf25b
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ icons/,\
+ product_lg.gif,\
+ splash.bmp
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/mail.ico b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/mail.ico
new file mode 100644
index 000000000..b00006113
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/mail.ico
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.gif b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.gif
new file mode 100644
index 000000000..34fb3c9d8
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.gif
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.icns b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.icns
new file mode 100644
index 000000000..1e92ccce1
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample.icns
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample2.gif b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample2.gif
new file mode 100644
index 000000000..252d7ebcb
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample2.gif
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample3.gif b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample3.gif
new file mode 100644
index 000000000..b949ac948
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/icons/sample3.gif
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/plugin.xml b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/plugin.xml
new file mode 100644
index 000000000..e786d2934
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/plugin.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ id="application"
+ point="org.eclipse.core.runtime.applications">
+ <application>
+ <run
+ class="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.Application">
+ </run>
+ </application>
+ </extension>
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ name="RCP Perspective"
+ class="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.Perspective"
+ id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.perspective">
+ </perspective>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ name="Message"
+ allowMultiple="true"
+ icon="icons/sample2.gif"
+ class="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.View"
+ id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.view">
+ </view>
+ <view
+ name="Mailboxes"
+ allowMultiple="true"
+ icon="icons/sample3.gif"
+ class="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.NavigationView"
+ id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.navigationView">
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.ui.commands">
+ <category
+ name="Mail"
+ id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.category">
+ </category>
+ <command
+ name="Open Mailbox"
+ description="Opens a mailbox"
+ categoryId="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.category"
+ id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.open">
+ </command>
+ <command
+ name="Open Message Dialog"
+ description="Open a message dialog"
+ categoryId="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.category"
+ id="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.openMessage">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.bindings">
+ <key
+ commandId="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.open"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="CTRL+2">
+ </key>
+ <key
+ commandId="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.openMessage"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="CTRL+3">
+ </key>
+ <key
+ commandId="org.eclipse.ui.file.exit"
+ schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
+ sequence="CTRL+X">
+ </key>
+ </extension>
+ <extension
+ id="product"
+ point="org.eclipse.core.runtime.products">
+ <product
+ application="org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.application"
+ name="RCP Product">
+ <property
+ name="aboutText"
+ value="RCP Mail template created by PDE">
+ </property>
+ <property
+ name="windowImages"
+ value="icons/sample2.gif">
+ </property>
+ <property
+ name="aboutImage"
+ value="product_lg.gif">
+ </property>
+ </product>
+ </extension>
+
+</plugin>
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/product_lg.gif b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/product_lg.gif
new file mode 100644
index 000000000..bd95e283f
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/product_lg.gif
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/splash.bmp b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/splash.bmp
new file mode 100644
index 000000000..d7d2e3032
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/splash.bmp
Binary files differ
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Activator.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Activator.java
new file mode 100644
index 000000000..c23f9256d
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Activator.java
@@ -0,0 +1,61 @@
+package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ 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;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Application.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Application.java
new file mode 100644
index 000000000..3279bab80
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Application.java
@@ -0,0 +1,45 @@
+package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
+
+import org.eclipse.equinox.app.IApplication;
+import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.PlatformUI;
+
+/**
+ * This class controls all aspects of the application's execution
+ */
+public class Application implements IApplication {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
+ */
+ public Object start(IApplicationContext context) {
+ Display display = PlatformUI.createDisplay();
+ try {
+ int returnCode = PlatformUI.createAndRunWorkbench(display, new ApplicationWorkbenchAdvisor());
+ if (returnCode == PlatformUI.RETURN_RESTART) {
+ return IApplication.EXIT_RESTART;
+ }
+ return IApplication.EXIT_OK;
+ } finally {
+ display.dispose();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.app.IApplication#stop()
+ */
+ public void stop() {
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ if (workbench == null)
+ return;
+ final Display display = workbench.getDisplay();
+ display.syncExec(new Runnable() {
+ public void run() {
+ if (!display.isDisposed())
+ workbench.close();
+ }
+ });
+ }
+}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationActionBarAdvisor.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationActionBarAdvisor.java
new file mode 100644
index 000000000..0794fc426
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationActionBarAdvisor.java
@@ -0,0 +1,108 @@
+package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.ICoolBarManager;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.action.ToolBarContributionItem;
+import org.eclipse.jface.action.ToolBarManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+
+/**
+ * An action bar advisor is responsible for creating, adding, and disposing of the
+ * actions added to a workbench window. Each window will be populated with
+ * new actions.
+ */
+public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
+
+ // Actions - important to allocate these only in makeActions, and then use them
+ // in the fill methods. This ensures that the actions aren't recreated
+ // when fillActionBars is called with FILL_PROXY.
+ private IWorkbenchAction exitAction;
+ private IWorkbenchAction aboutAction;
+ private IWorkbenchAction newWindowAction;
+ // XXX we want to show all update preferences
+ private IWorkbenchAction preferencesAction;
+ private OpenViewAction openViewAction;
+ private Action messagePopupAction;
+
+
+ public ApplicationActionBarAdvisor(IActionBarConfigurer configurer) {
+ super(configurer);
+ }
+
+ protected void makeActions(final IWorkbenchWindow window) {
+ // Creates the actions and registers them.
+ // Registering is needed to ensure that key bindings work.
+ // The corresponding commands keybindings are defined in the plugin.xml file.
+ // Registering also provides automatic disposal of the actions when
+ // the window is closed.
+
+ exitAction = ActionFactory.QUIT.create(window);
+ register(exitAction);
+
+ aboutAction = ActionFactory.ABOUT.create(window);
+ register(aboutAction);
+
+ newWindowAction = ActionFactory.OPEN_NEW_WINDOW.create(window);
+ register(newWindowAction);
+
+ //XXX preferences action
+ preferencesAction = ActionFactory.PREFERENCES.create(window);
+ register(preferencesAction);
+
+ openViewAction = new OpenViewAction(window, "Open Another Message View", View.ID);
+ register(openViewAction);
+
+ messagePopupAction = new MessagePopupAction("Open Message", window);
+ register(messagePopupAction);
+ }
+
+ protected void fillMenuBar(IMenuManager menuBar) {
+ MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
+ // XXX Window menu
+ MenuManager windowMenu = new MenuManager("&Window", IWorkbenchActionConstants.M_WINDOW);
+ MenuManager helpMenu = new MenuManager("&Help", IWorkbenchActionConstants.M_HELP);
+
+ menuBar.add(fileMenu);
+ // XXX Window menu
+ menuBar.add(windowMenu);
+ // Add a group marker indicating where action set menus will appear.
+ menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
+ menuBar.add(helpMenu);
+
+ // File
+ fileMenu.add(newWindowAction);
+ fileMenu.add(new Separator());
+ fileMenu.add(messagePopupAction);
+ fileMenu.add(openViewAction);
+ fileMenu.add(new Separator());
+ fileMenu.add(exitAction);
+
+ // XXX Window menu
+ windowMenu.add(preferencesAction);
+
+ // Help
+ // XXX add an additions group because this is what SDK UI expects
+ helpMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
+ helpMenu.add(new Separator());
+ helpMenu.add(aboutAction);
+
+ }
+
+ protected void fillCoolBar(ICoolBarManager coolBar) {
+ IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
+ coolBar.add(new ToolBarContributionItem(toolbar, "main"));
+ toolbar.add(openViewAction);
+ toolbar.add(messagePopupAction);
+ }
+}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchAdvisor.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchAdvisor.java
new file mode 100644
index 000000000..183ba01f2
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchAdvisor.java
@@ -0,0 +1,21 @@
+package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
+
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchAdvisor;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+/**
+ * This workbench advisor creates the window advisor, and specifies
+ * the perspective id for the initial window.
+ */
+public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
+
+ public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
+ return new ApplicationWorkbenchWindowAdvisor(configurer);
+ }
+
+ public String getInitialWindowPerspectiveId() {
+ return Perspective.ID;
+ }
+
+}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchWindowAdvisor.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchWindowAdvisor.java
new file mode 100644
index 000000000..94a996d07
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ApplicationWorkbenchWindowAdvisor.java
@@ -0,0 +1,29 @@
+package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
+
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.ui.application.ActionBarAdvisor;
+import org.eclipse.ui.application.IActionBarConfigurer;
+import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
+import org.eclipse.ui.application.WorkbenchWindowAdvisor;
+
+public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
+
+ public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
+ super(configurer);
+ }
+
+ public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
+ return new ApplicationActionBarAdvisor(configurer);
+ }
+
+ public void preWindowOpen() {
+ IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
+ configurer.setInitialSize(new Point(600, 400));
+ configurer.setShowCoolBar(true);
+ // XXX We set the status line and progress indicator so that update
+ // information can be shown there
+ configurer.setShowStatusLine(true);
+ configurer.setShowProgressIndicator(true);
+ }
+
+}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ICommandIds.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ICommandIds.java
new file mode 100644
index 000000000..018fef16d
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/ICommandIds.java
@@ -0,0 +1,15 @@
+package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
+
+/**
+ * Interface defining the application's command IDs.
+ * Key bindings can be defined for specific commands.
+ * To associate an action with a command, use IAction.setActionDefinitionId(commandId).
+ *
+ * @see org.eclipse.jface.action.IAction#setActionDefinitionId(String)
+ */
+public interface ICommandIds {
+
+ public static final String CMD_OPEN = "org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.open";
+ public static final String CMD_OPEN_MESSAGE = "org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.openMessage";
+
+}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/MessagePopupAction.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/MessagePopupAction.java
new file mode 100644
index 000000000..09cf1f900
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/MessagePopupAction.java
@@ -0,0 +1,25 @@
+package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.ui.IWorkbenchWindow;
+
+
+public class MessagePopupAction extends Action {
+
+ private final IWorkbenchWindow window;
+
+ MessagePopupAction(String text, IWorkbenchWindow window) {
+ super(text);
+ this.window = window;
+ // The id is used to refer to the action in a menu or toolbar
+ setId(ICommandIds.CMD_OPEN_MESSAGE);
+ // Associate the action with a pre-defined command, to allow key bindings.
+ setActionDefinitionId(ICommandIds.CMD_OPEN_MESSAGE);
+ setImageDescriptor(org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.Activator.getImageDescriptor("/icons/sample3.gif"));
+ }
+
+ public void run() {
+ MessageDialog.openInformation(window.getShell(), "Open", "Open Message Dialog!");
+ }
+} \ No newline at end of file
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/NavigationView.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/NavigationView.java
new file mode 100644
index 000000000..8eeaa6ece
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/NavigationView.java
@@ -0,0 +1,151 @@
+package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.ViewPart;
+
+public class NavigationView extends ViewPart {
+ public static final String ID = "org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.navigationView";
+ private TreeViewer viewer;
+
+ class TreeObject {
+ private String name;
+ private TreeParent parent;
+
+ public TreeObject(String name) {
+ this.name = name;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setParent(TreeParent parent) {
+ this.parent = parent;
+ }
+ public TreeParent getParent() {
+ return parent;
+ }
+ public String toString() {
+ return getName();
+ }
+ }
+
+ class TreeParent extends TreeObject {
+ private ArrayList children;
+ public TreeParent(String name) {
+ super(name);
+ children = new ArrayList();
+ }
+ public void addChild(TreeObject child) {
+ children.add(child);
+ child.setParent(this);
+ }
+ public void removeChild(TreeObject child) {
+ children.remove(child);
+ child.setParent(null);
+ }
+ public TreeObject[] getChildren() {
+ return (TreeObject[]) children.toArray(new TreeObject[children.size()]);
+ }
+ public boolean hasChildren() {
+ return children.size()>0;
+ }
+ }
+
+ class ViewContentProvider implements IStructuredContentProvider,
+ ITreeContentProvider {
+
+ public void inputChanged(Viewer v, Object oldInput, Object newInput) {
+ }
+
+ public void dispose() {
+ }
+
+ public Object[] getElements(Object parent) {
+ return getChildren(parent);
+ }
+
+ public Object getParent(Object child) {
+ if (child instanceof TreeObject) {
+ return ((TreeObject)child).getParent();
+ }
+ return null;
+ }
+
+ public Object[] getChildren(Object parent) {
+ if (parent instanceof TreeParent) {
+ return ((TreeParent)parent).getChildren();
+ }
+ return new Object[0];
+ }
+
+ public boolean hasChildren(Object parent) {
+ if (parent instanceof TreeParent)
+ return ((TreeParent)parent).hasChildren();
+ return false;
+ }
+ }
+
+ class ViewLabelProvider extends LabelProvider {
+
+ public String getText(Object obj) {
+ return obj.toString();
+ }
+ public Image getImage(Object obj) {
+ String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
+ if (obj instanceof TreeParent)
+ imageKey = ISharedImages.IMG_OBJ_FOLDER;
+ return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
+ }
+ }
+
+ /**
+ * We will set up a dummy model to initialize tree heararchy. In real
+ * code, you will connect to a real model and expose its hierarchy.
+ */
+ private TreeObject createDummyModel() {
+ TreeObject to1 = new TreeObject("Inbox");
+ TreeObject to2 = new TreeObject("Drafts");
+ TreeObject to3 = new TreeObject("Sent");
+ TreeParent p1 = new TreeParent("me@this.com");
+ p1.addChild(to1);
+ p1.addChild(to2);
+ p1.addChild(to3);
+
+ TreeObject to4 = new TreeObject("Inbox");
+ TreeParent p2 = new TreeParent("other@aol.com");
+ p2.addChild(to4);
+
+ TreeParent root = new TreeParent("");
+ root.addChild(p1);
+ root.addChild(p2);
+ return root;
+ }
+
+ /**
+ * This is a callback that will allow us to create the viewer and initialize
+ * it.
+ */
+ public void createPartControl(Composite parent) {
+ viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ viewer.setContentProvider(new ViewContentProvider());
+ viewer.setLabelProvider(new ViewLabelProvider());
+ viewer.setInput(createDummyModel());
+ }
+
+ /**
+ * Passing the focus request to the viewer's control.
+ */
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+} \ No newline at end of file
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/OpenViewAction.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/OpenViewAction.java
new file mode 100644
index 000000000..e55917985
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/OpenViewAction.java
@@ -0,0 +1,36 @@
+package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+public class OpenViewAction extends Action {
+
+ private final IWorkbenchWindow window;
+ private int instanceNum = 0;
+ private final String viewId;
+
+ public OpenViewAction(IWorkbenchWindow window, String label, String viewId) {
+ this.window = window;
+ this.viewId = viewId;
+ setText(label);
+ // The id is used to refer to the action in a menu or toolbar
+ setId(ICommandIds.CMD_OPEN);
+ // Associate the action with a pre-defined command, to allow key bindings.
+ setActionDefinitionId(ICommandIds.CMD_OPEN);
+ setImageDescriptor(org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.Activator.getImageDescriptor("/icons/sample2.gif"));
+ }
+
+ public void run() {
+ if(window != null) {
+ try {
+ window.getActivePage().showView(viewId, Integer.toString(instanceNum++), IWorkbenchPage.VIEW_ACTIVATE);
+ } catch (PartInitException e) {
+ MessageDialog.openError(window.getShell(), "Error", "Error opening view:" + e.getMessage());
+ }
+ }
+ }
+}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Perspective.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Perspective.java
new file mode 100644
index 000000000..dbe205e64
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/Perspective.java
@@ -0,0 +1,25 @@
+package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+public class Perspective implements IPerspectiveFactory {
+
+ /**
+ * The ID of the perspective as specified in the extension.
+ */
+ public static final String ID = "org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.perspective";
+
+ public void createInitialLayout(IPageLayout layout) {
+ String editorArea = layout.getEditorArea();
+ layout.setEditorAreaVisible(false);
+
+ layout.addStandaloneView(NavigationView.ID, false, IPageLayout.LEFT, 0.25f, editorArea);
+ IFolderLayout folder = layout.createFolder("messages", IPageLayout.TOP, 0.5f, editorArea);
+ folder.addPlaceholder(View.ID + ":*");
+ folder.addView(View.ID);
+
+ layout.getViewLayout(NavigationView.ID).setCloseable(false);
+ }
+}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/View.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/View.java
new file mode 100644
index 000000000..ec39948c7
--- /dev/null
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates/src/org/eclipse/equinox/p2/examples/rcp/sdknoautoupdates/View.java
@@ -0,0 +1,77 @@
+package org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.part.ViewPart;
+
+public class View extends ViewPart {
+
+ public static final String ID = "org.eclipse.equinox.p2.examples.rcp.sdknoautoupdates.view";
+
+ public void createPartControl(Composite parent) {
+ Composite top = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 0;
+ layout.marginWidth = 0;
+ top.setLayout(layout);
+ // top banner
+ Composite banner = new Composite(top, SWT.NONE);
+ banner.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL, GridData.VERTICAL_ALIGN_BEGINNING, true, false));
+ layout = new GridLayout();
+ layout.marginHeight = 5;
+ layout.marginWidth = 10;
+ layout.numColumns = 2;
+ banner.setLayout(layout);
+
+ // setup bold font
+ Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
+
+ Label l = new Label(banner, SWT.WRAP);
+ l.setText("Subject:");
+ l.setFont(boldFont);
+ l = new Label(banner, SWT.WRAP);
+ l.setText("This is a message about the cool Eclipse RCP!");
+
+ l = new Label(banner, SWT.WRAP);
+ l.setText("From:");
+ l.setFont(boldFont);
+
+ final Link link = new Link(banner, SWT.NONE);
+ link.setText("<a>nicole@mail.org</a>");
+ link.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ MessageDialog.openInformation(getSite().getShell(), "Not Implemented", "Imagine the address book or a new message being created now.");
+ }
+ });
+
+ l = new Label(banner, SWT.WRAP);
+ l.setText("Date:");
+ l.setFont(boldFont);
+ l = new Label(banner, SWT.WRAP);
+ l.setText("10:34 am");
+ // message contents
+ Text text = new Text(top, SWT.MULTI | SWT.WRAP);
+ text.setText("This RCP Application was generated from the PDE Plug-in Project wizard. This sample shows how to:\n"+
+ "- add a top-level menu and toolbar with actions\n"+
+ "- add keybindings to actions\n" +
+ "- create views that can't be closed and\n"+
+ " multiple instances of the same view\n"+
+ "- perspectives with placeholders for new views\n"+
+ "- use the default about dialog\n"+
+ "- create a product definition\n");
+ text.setLayoutData(new GridData(GridData.FILL_BOTH));
+ }
+
+ public void setFocus() {
+ }
+}

Back to the top