Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/debug
diff options
context:
space:
mode:
authorAnton Leherbauer2008-03-28 15:39:09 +0000
committerAnton Leherbauer2008-03-28 15:39:09 +0000
commitdd9db085d7acdb2e6d8dd0538a7044ba5832e8cf (patch)
tree610254582f8868809ac1370317fee13489aad91d /debug
parentd0e1ee1473a109aa18a0e6d252dfdb9a2dc263a0 (diff)
downloadorg.eclipse.cdt-dd9db085d7acdb2e6d8dd0538a7044ba5832e8cf.tar.gz
org.eclipse.cdt-dd9db085d7acdb2e6d8dd0538a7044ba5832e8cf.tar.xz
org.eclipse.cdt-dd9db085d7acdb2e6d8dd0538a7044ba5832e8cf.zip
Get rid of SharedTextColors
Diffstat (limited to 'debug')
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/SharedTextColors.java76
-rw-r--r--debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java14
2 files changed, 4 insertions, 86 deletions
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/SharedTextColors.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/SharedTextColors.java
deleted file mode 100644
index 46b016c39f..0000000000
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/editors/SharedTextColors.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.cdt.debug.internal.ui.editors;
-
-import java.util.Iterator;
-import org.eclipse.swt.widgets.Display;
-import java.util.Map;
-import java.util.HashMap;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.jface.text.source.ISharedTextColors;
-import org.eclipse.swt.graphics.RGB;
-
-/*
- * @see org.eclipse.jface.text.source.ISharedTextColors
- * @since 2.1
- */
-class SharedTextColors implements ISharedTextColors {
-
- /** The display table. */
- private Map fDisplayTable;
-
- /** Creates an returns a shared color manager. */
- public SharedTextColors() {
- super();
- }
-
- /*
- * @see ISharedTextColors#getColor(RGB)
- */
- public Color getColor(RGB rgb) {
- if (rgb == null)
- return null;
-
- if (fDisplayTable == null)
- fDisplayTable= new HashMap(2);
-
- Display display= Display.getCurrent();
-
- Map colorTable= (Map) fDisplayTable.get(display);
- if (colorTable == null) {
- colorTable= new HashMap(10);
- fDisplayTable.put(display, colorTable);
- }
-
- Color color= (Color) colorTable.get(rgb);
- if (color == null) {
- color= new Color(display, rgb);
- colorTable.put(rgb, color);
- }
-
- return color;
- }
-
- /*
- * @see ISharedTextColors#dispose()
- */
- public void dispose() {
- if (fDisplayTable != null) {
- Iterator j= fDisplayTable.values().iterator();
- while (j.hasNext()) {
- Iterator i= ((Map) j.next()).values().iterator();
- while (i.hasNext())
- ((Color) i.next()).dispose();
- }
- }
- }
-
-}
diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java
index 4398765025..4b378853e1 100644
--- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java
+++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/ui/CDebugUIPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 QNX Software Systems and others.
+ * Copyright (c) 2004, 2008 QNX Software Systems 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
@@ -8,6 +8,7 @@
* Contributors:
* QNX Software Systems - Initial API and implementation
* ARM Limited - https://bugs.eclipse.org/bugs/show_bug.cgi?id=186981
+ * Anton Leherbauer (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.debug.ui;
@@ -43,6 +44,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -66,8 +68,6 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
private CDebugImageDescriptorRegistry fImageDescriptorRegistry;
- private ISharedTextColors fSharedTextColors;
-
/**
* The constructor.
*/
@@ -276,10 +276,6 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
*/
public void stop( BundleContext context ) throws Exception {
CDebugCorePlugin.getDefault().removeCBreakpointListener( CBreakpointUpdater.getInstance() );
- if ( fSharedTextColors != null ) {
- fSharedTextColors.dispose();
- fSharedTextColors = null;
- }
if ( fImageDescriptorRegistry != null ) {
fImageDescriptorRegistry.dispose();
}
@@ -293,8 +289,6 @@ public class CDebugUIPlugin extends AbstractUIPlugin {
* @since 3.1
*/
public ISharedTextColors getSharedTextColors() {
- if ( fSharedTextColors == null )
- fSharedTextColors = CUIPlugin.getDefault().getSharedTextColors();
- return fSharedTextColors;
+ return EditorsUI.getSharedTextColors();
}
}

Back to the top