summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorMickael Istria2013-10-09 13:10:30 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-10-17 15:52:42 (EDT)
commit6f683624f6227cecc133b02c0f763faddb94176d (patch)
tree6dce59e23b1285d65494220ee7713c521af8c362
parent4d09b580d350e3fa5704595ed663809a5133a6da (diff)
downloadeclipse.platform.ui-6f683624f6227cecc133b02c0f763faddb94176d.zip
eclipse.platform.ui-6f683624f6227cecc133b02c0f763faddb94176d.tar.gz
eclipse.platform.ui-6f683624f6227cecc133b02c0f763faddb94176d.tar.bz2
Bug 418857: "About" menu shows product iconrefs/changes/27/17227/2
Signed-off-by: Mickael Istria <mistria@redhat.com>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandImagePersistence.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandImagePersistence.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandImagePersistence.java
index 1aff2d8..07c25f4 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandImagePersistence.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/commands/CommandImagePersistence.java
@@ -11,19 +11,23 @@
package org.eclipse.ui.internal.commands;
+import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionDelta;
import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.IProduct;
import org.eclipse.core.runtime.IRegistryChangeEvent;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants;
import org.eclipse.ui.internal.services.RegistryPersistence;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.Bundle;
/**
* <p>
@@ -202,5 +206,27 @@ public final class CommandImagePersistence extends RegistryPersistence {
readImagesFromRegistry(indexedConfigurationElements[INDEX_IMAGES],
imageCount, commandImageManager, commandService);
+ // Associate product icon to About command
+ IProduct product = Platform.getProduct();
+ if (product != null) {
+ Bundle productBundle = product.getDefiningBundle();
+ if (productBundle != null) {
+ String imageList = product.getProperty("windowImages"); //$NON-NLS-1$
+ if (imageList != null) {
+ String iconPath = imageList.split(",")[0]; //$NON-NLS-1$
+ URL iconUrl = productBundle.getEntry(iconPath);
+ ImageDescriptor icon = ImageDescriptor.createFromURL(iconUrl);
+ if (icon != null) {
+ commandImageManager.bind(IWorkbenchCommandConstants.HELP_ABOUT,
+ CommandImageManager.TYPE_DEFAULT, null, icon);
+ commandImageManager.bind(IWorkbenchCommandConstants.HELP_ABOUT,
+ CommandImageManager.TYPE_DISABLED, null, icon);
+ commandImageManager.bind(IWorkbenchCommandConstants.HELP_ABOUT,
+ CommandImageManager.TYPE_HOVER, null, icon);
+ }
+
+ }
+ }
+ }
}
}