Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWojciech Sudol2015-01-08 11:30:38 +0000
committerDani Megert2015-01-08 11:30:38 +0000
commitfac29a290b4fa55f808342241b465990e0ef8293 (patch)
treeca10344132cb5c22ed0d44299f6bf7eb74b5ec1e
parentf765fabe01ad098c12731fca740b8c7fa4ad584a (diff)
downloadeclipse.platform.ui-fac29a290b4fa55f808342241b465990e0ef8293.tar.gz
eclipse.platform.ui-fac29a290b4fa55f808342241b465990e0ef8293.tar.xz
eclipse.platform.ui-fac29a290b4fa55f808342241b465990e0ef8293.zip
Fixed bug 429327: Image/Icon information returned by EditorReference implementation is inconsistent with the IEditorPart implementation
Signed-off-by: Wojciech Sudol <wojciech.sudol@pl.ibm.com>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java21
1 files changed, 19 insertions, 2 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java
index 7fe8a66b95e..8517aa07ade 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 IBM Corporation and others.
+ * Copyright (c) 2000, 2014 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
@@ -134,6 +134,12 @@ public abstract class WorkbenchPartReference implements IWorkbenchPartReference,
*/
private Image image = null;
+ /**
+ * Stores reference to the image kept in the legacyPart. Used for quick check
+ * if the image changed.
+ */
+ private Image legacyPartImage = null;
+
private ImageDescriptor defaultImageDescriptor;
/**
@@ -402,7 +408,18 @@ public abstract class WorkbenchPartReference implements IWorkbenchPartReference,
return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEF_VIEW);
}
- if (image == null) {
+ Image newLegacyPartImage = null;
+ if (legacyPart != null) {
+ newLegacyPartImage = legacyPart.getTitleImage();
+ }
+ // refresh the local image if the image in the legacyPart changed
+ if (newLegacyPartImage != null && newLegacyPartImage != legacyPartImage) {
+ legacyPartImage = newLegacyPartImage;
+ // the setImageDescriptor(ImageDescriptor) method sets the image field to null,
+ // so a new value will be assigned to the image in the conditional statement below
+ setImageDescriptor(computeImageDescriptor());
+ }
+ if (image == null) {
image = JFaceResources.getResources().createImageWithDefault(imageDescriptor);
}
return image;

Back to the top