mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
fixed Eclipse 3.0M4 build problems
This commit is contained in:
parent
8720297f8a
commit
fa2d7106db
5 changed files with 105 additions and 4 deletions
|
@ -1,3 +1,12 @@
|
|||
2003-10-17 David Inglis
|
||||
|
||||
Fix build error with Eclipse 3.0.
|
||||
|
||||
* src/org/eclipse/cdt/internal/ui/editor/CEditor.java
|
||||
* src/org/eclipse/cdt/internal/ui/editor/CMarkerAnnotationModel.java
|
||||
* src/org/eclipse/cdt/internal/ui/editor/SharedTextColors.java
|
||||
* src/org/eclipse/cdt/ui/CUIPlugin.java
|
||||
|
||||
2003-10-16 Alain Magloire
|
||||
|
||||
Fix null out the dynamic parser page, it not selected.
|
||||
|
|
|
@ -805,7 +805,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener {
|
|||
}
|
||||
}
|
||||
fAnnotationAccess = createAnnotationAccess();
|
||||
ISharedTextColors sharedColors = EditorsPlugin.getDefault().getSharedTextColors();
|
||||
ISharedTextColors sharedColors = CUIPlugin.getDefault().getSharedTextColors();
|
||||
|
||||
fOverviewRuler = new OverviewRuler(fAnnotationAccess, VERTICAL_RULER_WIDTH, sharedColors);
|
||||
Iterator e = fAnnotationPreferences.getAnnotationPreferences().iterator();
|
||||
|
|
|
@ -51,7 +51,7 @@ public class CMarkerAnnotationModel extends ResourceMarkerAnnotationModel {
|
|||
* @param position the associate position
|
||||
* @param fireModelChange indicates whether to notify all model listeners
|
||||
*/
|
||||
protected void addAnnotation(Annotation annotation, Position position, boolean fireModelChanged) {
|
||||
protected void addAnnotation(Annotation annotation, Position position, boolean fireModelChanged){
|
||||
if (!fAnnotations.containsKey(annotation)) {
|
||||
|
||||
// @@@ This is an unfortunate hack because we cannot override addAnnotationMarker() and if we
|
||||
|
@ -64,7 +64,10 @@ public class CMarkerAnnotationModel extends ResourceMarkerAnnotationModel {
|
|||
}
|
||||
}
|
||||
fAnnotations.put(annotation, position);
|
||||
try {
|
||||
addPosition(fDocument, position);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
if (fireModelChanged)
|
||||
fireModelChanged();
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2000, 2003 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Common Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/cpl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.internal.ui.editor;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.jface.text.source.ISharedTextColors;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
/*
|
||||
* @see org.eclipse.jface.text.source.ISharedTextColors
|
||||
* @since 2.1
|
||||
*/
|
||||
public 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -27,6 +27,7 @@ import org.eclipse.cdt.internal.ui.CPluginImages;
|
|||
import org.eclipse.cdt.internal.ui.ResourceAdapterFactory;
|
||||
import org.eclipse.cdt.internal.ui.cview.CView;
|
||||
import org.eclipse.cdt.internal.ui.editor.CDocumentProvider;
|
||||
import org.eclipse.cdt.internal.ui.editor.SharedTextColors;
|
||||
import org.eclipse.cdt.internal.ui.editor.WorkingCopyManager;
|
||||
import org.eclipse.cdt.internal.ui.editor.asm.AsmTextTools;
|
||||
import org.eclipse.cdt.internal.ui.preferences.BuildConsolePreferencePage;
|
||||
|
@ -46,6 +47,7 @@ import org.eclipse.core.runtime.Platform;
|
|||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.dialogs.ErrorDialog;
|
||||
import org.eclipse.jface.preference.IPreferenceStore;
|
||||
import org.eclipse.jface.text.source.ISharedTextColors;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.IWorkbenchPage;
|
||||
|
@ -54,6 +56,8 @@ import org.eclipse.ui.plugin.AbstractUIPlugin;
|
|||
|
||||
public class CUIPlugin extends AbstractUIPlugin {
|
||||
|
||||
private ISharedTextColors fSharedTextColors;
|
||||
|
||||
public static final String PLUGIN_ID = "org.eclipse.cdt.ui";
|
||||
public static final String PLUGIN_CORE_ID = "org.eclipse.cdt.core";
|
||||
public static final String EDITOR_ID = PLUGIN_ID + ".editor.CEditor";
|
||||
|
@ -356,7 +360,7 @@ public class CUIPlugin extends AbstractUIPlugin {
|
|||
return fProblemMarkerManager;
|
||||
}
|
||||
|
||||
private void registerAdapters() {
|
||||
protected void registerAdapters() {
|
||||
fResourceAdapterFactory = new ResourceAdapterFactory();
|
||||
fCElementAdapterFactory = new CElementAdapterFactory();
|
||||
|
||||
|
@ -370,4 +374,10 @@ public class CUIPlugin extends AbstractUIPlugin {
|
|||
manager.unregisterAdapters(fResourceAdapterFactory);
|
||||
manager.unregisterAdapters(fCElementAdapterFactory);
|
||||
}
|
||||
|
||||
public ISharedTextColors getSharedTextColors() {
|
||||
if (fSharedTextColors == null)
|
||||
fSharedTextColors= new SharedTextColors();
|
||||
return fSharedTextColors;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue