Commit 73bd3d84 authored by Jay Herron's avatar Jay Herron

Adjusted so TrioEditor respects general text editor tab space settings.

parent 890dc8eb
......@@ -16,12 +16,11 @@ import org.eclipse.swt.widgets.Display;
*/
public class ColorManager {
protected Map fColorTable = new HashMap(10);
protected Map<RGB,Color> fColorTable = new HashMap<RGB,Color>(10);
public void dispose() {
Iterator e = fColorTable.values().iterator();
while (e.hasNext())
((Color) e.next()).dispose();
Iterator<Color> e = fColorTable.values().iterator();
while (e.hasNext()) e.next().dispose();
}
public Color getColor(RGB rgb) {
Color color = (Color) fColorTable.get(rgb);
......
package org.jayherron.trioeditor.editors;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.presentation.IPresentationReconciler;
......@@ -21,7 +22,8 @@ public class TrioConfiguration extends TextSourceViewerConfiguration {
private TrioScanner scanner;
private ColorManager colorManager;
public TrioConfiguration(ColorManager colorManager) {
public TrioConfiguration(ColorManager colorManager, IPreferenceStore prefStore) {
super(prefStore); // This makes the TrioEditor respond correctly to the TextEditor preferences.
this.colorManager = colorManager;
scanner = new TrioScanner(colorManager);
......
......@@ -18,9 +18,9 @@ public class TrioEditor extends TextEditor {
private DefaultCharacterPairMatcher pairsMatcher = new DefaultCharacterPairMatcher(PAIRS);
public TrioEditor() {
super();
super(); // Creates the TextEditor preference store.
colorManager = new ColorManager();
setSourceViewerConfiguration(new TrioConfiguration(colorManager));
setSourceViewerConfiguration(new TrioConfiguration(colorManager, getPreferenceStore()));
setDocumentProvider(new TrioDocumentProvider());
}
@Override
......
package org.jayherron.trioeditor.editors;
import org.eclipse.jface.text.TextAttribute;
import org.eclipse.jface.text.rules.*;
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment