Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Webster2007-11-08 14:27:49 +0000
committerPaul Webster2007-11-08 14:27:49 +0000
commit40d8e3cb20f2cb8579e3f45fa30eb335dec05e4e (patch)
tree2e458f8c33f6ff6bb81ac5470fa3ec206f33ab1c /bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus
parentc86c45aff4a6b56fd4ae69eeb469df796af9c594 (diff)
downloadeclipse.platform.ui-40d8e3cb20f2cb8579e3f45fa30eb335dec05e4e.tar.gz
eclipse.platform.ui-40d8e3cb20f2cb8579e3f45fa30eb335dec05e4e.tar.xz
eclipse.platform.ui-40d8e3cb20f2cb8579e3f45fa30eb335dec05e4e.zip
Bug 164499 [Commands] org.eclipse.ui.commandImages API and documentation error
Move ICommandImageService into API and make sure it is used by org.eclipse.ui.menus
Diffstat (limited to 'bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus')
-rwxr-xr-xbundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java15
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItemParameter.java7
2 files changed, 15 insertions, 7 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
index 712a233c22d..fdc58e5680c 100755
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItem.java
@@ -44,12 +44,12 @@ import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.commands.ICommandImageService;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.commands.IElementReference;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.help.IWorkbenchHelpSystem;
import org.eclipse.ui.internal.WorkbenchPlugin;
-import org.eclipse.ui.internal.commands.ICommandImageService;
import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.services.IServiceLocator;
@@ -132,7 +132,7 @@ public final class CommandContributionItem extends ContributionItem {
* Create a CommandContributionItem to place in a ContributionManager.
*
* @param contributionParameters
- * paramters necessary to render this contribution item.
+ * parameters necessary to render this contribution item.
*/
public CommandContributionItem(
CommandContributionItemParameter contributionParameters) {
@@ -194,7 +194,8 @@ public final class CommandContributionItem extends ContributionItem {
elementRef = commandService.registerElementForCommand(command,
callback);
command.getCommand().addCommandListener(getCommandListener());
- setImages(contributionParameters.serviceLocator);
+ setImages(contributionParameters.serviceLocator,
+ contributionParameters.iconStyle);
if (contributionParameters.helpContextId == null) {
try {
@@ -262,16 +263,16 @@ public final class CommandContributionItem extends ContributionItem {
mnemonic, tooltip, style, null));
}
- private void setImages(IServiceLocator locator) {
+ private void setImages(IServiceLocator locator, String iconStyle) {
if (icon == null) {
ICommandImageService service = (ICommandImageService) locator
.getService(ICommandImageService.class);
icon = service.getImageDescriptor(command.getId(),
- ICommandImageService.TYPE_DEFAULT);
+ ICommandImageService.TYPE_DEFAULT, iconStyle);
disabledIcon = service.getImageDescriptor(command.getId(),
- ICommandImageService.TYPE_DISABLED);
+ ICommandImageService.TYPE_DISABLED, iconStyle);
hoverIcon = service.getImageDescriptor(command.getId(),
- ICommandImageService.TYPE_HOVER);
+ ICommandImageService.TYPE_HOVER, iconStyle);
}
}
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItemParameter.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItemParameter.java
index 340ed1692d8..1e3995e96be 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItemParameter.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/menus/CommandContributionItemParameter.java
@@ -97,6 +97,13 @@ public class CommandContributionItemParameter {
public String helpContextId;
/**
+ * The icon style to use. May be <code>null</code> for default style.
+ *
+ * @see org.eclipse.ui.commands.ICommandImageService
+ */
+ public String iconStyle;
+
+ /**
* Create the parameter object. Nullable attributes can be set directly.
*
* @param serviceLocator

Back to the top