|
Lines 11-16
Link Here
|
| 11 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
| 12 |
package org.eclipse.ui.internal.handlers; |
12 |
package org.eclipse.ui.internal.handlers; |
| 13 |
|
13 |
|
|
|
14 |
import java.util.Map; |
| 14 |
import org.eclipse.core.commands.AbstractHandler; |
15 |
import org.eclipse.core.commands.AbstractHandler; |
| 15 |
import org.eclipse.core.commands.ExecutionEvent; |
16 |
import org.eclipse.core.commands.ExecutionEvent; |
| 16 |
import org.eclipse.core.commands.ExecutionException; |
17 |
import org.eclipse.core.commands.ExecutionException; |
|
Lines 28-33
Link Here
|
| 28 |
import org.eclipse.ui.IWorkbenchWindow; |
29 |
import org.eclipse.ui.IWorkbenchWindow; |
| 29 |
import org.eclipse.ui.IWorkbenchWizard; |
30 |
import org.eclipse.ui.IWorkbenchWizard; |
| 30 |
import org.eclipse.ui.PlatformUI; |
31 |
import org.eclipse.ui.PlatformUI; |
|
|
32 |
import org.eclipse.ui.commands.IElementUpdater; |
| 31 |
import org.eclipse.ui.handlers.HandlerUtil; |
33 |
import org.eclipse.ui.handlers.HandlerUtil; |
| 32 |
import org.eclipse.ui.internal.IWorkbenchHelpContextIds; |
34 |
import org.eclipse.ui.internal.IWorkbenchHelpContextIds; |
| 33 |
import org.eclipse.ui.internal.LegacyResourceSupport; |
35 |
import org.eclipse.ui.internal.LegacyResourceSupport; |
|
Lines 35-40
Link Here
|
| 35 |
import org.eclipse.ui.internal.dialogs.ImportExportWizard; |
37 |
import org.eclipse.ui.internal.dialogs.ImportExportWizard; |
| 36 |
import org.eclipse.ui.internal.dialogs.NewWizard; |
38 |
import org.eclipse.ui.internal.dialogs.NewWizard; |
| 37 |
import org.eclipse.ui.internal.util.Util; |
39 |
import org.eclipse.ui.internal.util.Util; |
|
|
40 |
import org.eclipse.ui.menus.UIElement; |
| 38 |
import org.eclipse.ui.wizards.IWizardDescriptor; |
41 |
import org.eclipse.ui.wizards.IWizardDescriptor; |
| 39 |
import org.eclipse.ui.wizards.IWizardRegistry; |
42 |
import org.eclipse.ui.wizards.IWizardRegistry; |
| 40 |
|
43 |
|
|
Lines 47-53
Link Here
|
| 47 |
* |
50 |
* |
| 48 |
* @since 3.2 |
51 |
* @since 3.2 |
| 49 |
*/ |
52 |
*/ |
| 50 |
public abstract class WizardHandler extends AbstractHandler { |
53 |
public abstract class WizardHandler extends AbstractHandler implements IElementUpdater { |
| 51 |
|
54 |
|
| 52 |
/** |
55 |
/** |
| 53 |
* Default handler for launching export wizards. |
56 |
* Default handler for launching export wizards. |
|
Lines 318-323
Link Here
|
| 318 |
return StructuredSelection.EMPTY; |
321 |
return StructuredSelection.EMPTY; |
| 319 |
} |
322 |
} |
| 320 |
|
323 |
|
|
|
324 |
public void updateElement(UIElement element, Map parameters) { |
| 325 |
|
| 326 |
String wizardId = (String) parameters.get(getWizardIdParameterId()); |
| 327 |
if (wizardId == null) |
| 328 |
return; |
| 329 |
IWizardDescriptor wizard = getWizardRegistry().findWizard(wizardId); |
| 330 |
if (wizard != null) { |
| 331 |
element.setText(wizard.getLabel()); |
| 332 |
element.setTooltip(wizard.getDescription()); |
| 333 |
element.setIcon(wizard.getImageDescriptor()); |
| 334 |
} |
| 335 |
} |
| 336 |
|
| 321 |
/** |
337 |
/** |
| 322 |
* Returns the id of the parameter used to indicate which wizard this |
338 |
* Returns the id of the parameter used to indicate which wizard this |
| 323 |
* command should launch. |
339 |
* command should launch. |