Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2004-10-19 17:44:40 +0000
committerDarin Wright2004-10-19 17:44:40 +0000
commit7079379e012608878ef3303f657c2d1e4d71304f (patch)
treed3932a9d14c464e8d671bb4ad2b092e5e9487e22 /org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
parentde170114364f98e091c1aa9f44e9e81a363ce4cf (diff)
downloadeclipse.platform.debug-7079379e012608878ef3303f657c2d1e4d71304f.tar.gz
eclipse.platform.debug-7079379e012608878ef3303f657c2d1e4d71304f.tar.xz
eclipse.platform.debug-7079379e012608878ef3303f657c2d1e4d71304f.zip
Bug 76514 - Allow debug presentations to provide colors
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java42
1 files changed, 41 insertions, 1 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
index 15c101e30..466c71653 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DelegatingModelPresentation.java
@@ -34,8 +34,12 @@ import org.eclipse.debug.ui.IDebugEditorPresentation;
import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.debug.ui.IValueDetailListener;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
@@ -47,7 +51,7 @@ import org.eclipse.ui.IEditorPart;
* asked to render an object from a debug model, this presentation delegates
* to the extension registered for that debug model.
*/
-public class DelegatingModelPresentation implements IDebugModelPresentation, IDebugEditorPresentation {
+public class DelegatingModelPresentation implements IDebugModelPresentation, IDebugEditorPresentation, IColorProvider, IFontProvider {
/**
* A mapping of attribute ids to their values
@@ -343,4 +347,40 @@ public class DelegatingModelPresentation implements IDebugModelPresentation, IDe
protected void setLabelProviders(HashMap labelProviders) {
fLabelProviders = labelProviders;
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
+ */
+ public Color getForeground(Object element) {
+ IDebugModelPresentation presentation = getConfiguredPresentation(element);
+ if (presentation instanceof IColorProvider) {
+ IColorProvider colorProvider = (IColorProvider) presentation;
+ return colorProvider.getForeground(element);
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
+ */
+ public Color getBackground(Object element) {
+ IDebugModelPresentation presentation = getConfiguredPresentation(element);
+ if (presentation instanceof IColorProvider) {
+ IColorProvider colorProvider = (IColorProvider) presentation;
+ return colorProvider.getBackground(element);
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IFontProvider#getFont(java.lang.Object)
+ */
+ public Font getFont(Object element) {
+ IDebugModelPresentation presentation = getConfiguredPresentation(element);
+ if (presentation instanceof IFontProvider) {
+ IFontProvider fontProvider = (IFontProvider) presentation;
+ return fontProvider.getFont(element);
+ }
+ return null;
+ }
}

Back to the top