aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrakash Rangaraj2010-10-14 01:33:51 (EDT)
committerPaul Webster2012-03-12 15:04:45 (EDT)
commit05ec13e27fe45d43ada84e49f46b45f7822813f8 (patch)
tree924ca0a0096ff6af444327934380e70e8be8439b
parentcc2fde31224e85afdd2c0d0d4a4c906f4afd7e79 (diff)
downloadeclipse.platform.ui-05ec13e27fe45d43ada84e49f46b45f7822813f8.zip
eclipse.platform.ui-05ec13e27fe45d43ada84e49f46b45f7822813f8.tar.gz
eclipse.platform.ui-05ec13e27fe45d43ada84e49f46b45f7822813f8.tar.bz2
[Bug 327690] WizardHandlers could update the contribution's UI properties
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java18
1 files changed, 17 insertions, 1 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
index 6a34bd2..f99576e 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/WizardHandler.java
@@ -11,6 +11,7 @@
*******************************************************************************/
package org.eclipse.ui.internal.handlers;
+import java.util.Map;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
@@ -28,6 +29,7 @@ import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.IWorkbenchWizard;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.internal.IWorkbenchHelpContextIds;
import org.eclipse.ui.internal.LegacyResourceSupport;
@@ -35,6 +37,7 @@ import org.eclipse.ui.internal.WorkbenchPlugin;
import org.eclipse.ui.internal.dialogs.ImportExportWizard;
import org.eclipse.ui.internal.dialogs.NewWizard;
import org.eclipse.ui.internal.util.Util;
+import org.eclipse.ui.menus.UIElement;
import org.eclipse.ui.wizards.IWizardDescriptor;
import org.eclipse.ui.wizards.IWizardRegistry;
@@ -47,7 +50,7 @@ import org.eclipse.ui.wizards.IWizardRegistry;
*
* @since 3.2
*/
-public abstract class WizardHandler extends AbstractHandler {
+public abstract class WizardHandler extends AbstractHandler implements IElementUpdater {
/**
* Default handler for launching export wizards.
@@ -318,6 +321,19 @@ public abstract class WizardHandler extends AbstractHandler {
return StructuredSelection.EMPTY;
}
+ public void updateElement(UIElement element, Map parameters) {
+
+ String wizardId = (String) parameters.get(getWizardIdParameterId());
+ if (wizardId == null)
+ return;
+ IWizardDescriptor wizard = getWizardRegistry().findWizard(wizardId);
+ if (wizard != null) {
+ element.setText(wizard.getLabel());
+ element.setTooltip(wizard.getDescription());
+ element.setIcon(wizard.getImageDescriptor());
+ }
+ }
+
/**
* Returns the id of the parameter used to indicate which wizard this
* command should launch.