219846 Command handlers for invoking update functionality
diff --git a/update/org.eclipse.update.ui/plugin.xml b/update/org.eclipse.update.ui/plugin.xml
index 9e6e541..9a1fbc5 100644
--- a/update/org.eclipse.update.ui/plugin.xml
+++ b/update/org.eclipse.update.ui/plugin.xml
@@ -57,4 +57,17 @@
label="%preferenceKeywords.general"
id="org.eclipse.update.ui.general"/>
</extension>
+
+ <extension
+ point="org.eclipse.ui.handlers">
+ <handler
+ class="org.eclipse.update.internal.ui.views.ManageConfigurationHandler"
+ commandId="org.eclipse.ui.update.manageConfiguration">
+ </handler>
+ <handler
+ class="org.eclipse.update.internal.ui.views.FindAndInstallHandler"
+ commandId="org.eclipse.ui.update.findAndInstallUpdates">
+ </handler>
+ </extension>
+
</plugin>
diff --git a/update/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/views/FindAndInstallHandler.java b/update/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/views/FindAndInstallHandler.java
new file mode 100644
index 0000000..19c5de9
--- /dev/null
+++ b/update/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/views/FindAndInstallHandler.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.update.internal.ui.views;
+
+import org.eclipse.core.commands.*;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.update.ui.UpdateManagerUI;
+
+/**
+ * This handler is hooked to a command provided by the application (such
+ * as org.eclipse.ui.ide). This allows RCP applications to control how update
+ * functionality is surfaced.
+ */
+public class FindAndInstallHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ UpdateManagerUI.openInstaller(HandlerUtil.getActiveShell(event));
+ return null;
+ }
+
+}
diff --git a/update/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/views/ManageConfigurationHandler.java b/update/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/views/ManageConfigurationHandler.java
new file mode 100644
index 0000000..ebb2736
--- /dev/null
+++ b/update/org.eclipse.update.ui/src/org/eclipse/update/internal/ui/views/ManageConfigurationHandler.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.update.internal.ui.views;
+
+import org.eclipse.core.commands.*;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.update.ui.UpdateManagerUI;
+
+/**
+ * This handler is hooked to a command provided by the application (such
+ * as org.eclipse.ui.ide). This allows RCP applications to control how update
+ * functionality is surfaced.
+ */
+public class ManageConfigurationHandler extends AbstractHandler {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
+ */
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ UpdateManagerUI.openConfigurationManager(HandlerUtil.getActiveShell(event));
+ return null;
+ }
+
+}