Commit ec0ab2b5 authored by Simon Barner's avatar Simon Barner
Browse files

Avoid leakage of Font resources.

refs 2709
parent 054f6a75
CodeSpecificationEditor.java 461d9b6668dfeeb0debd34e9f725d49cc8bbbea2 RED
CodeSpecificationEditor.java 7afe41a1f3aaa983c223d62a434fb89bec31baa8 RED
CodeSpecificationEditorBinding.java a0cff3224d8d0755e948188c2480e528c82eb590 GREEN
ComponentArchitectureEditorBinding.java 262e86525dda985d7baaee6a90150d34389b34ca GREEN
ComponentStructureEditor.java 11aee03b8db78a93a7704a8b8240b84a6d192012 GREEN
......
......@@ -41,6 +41,8 @@ import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ST;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Font;
......@@ -183,7 +185,8 @@ public class CodeSpecificationEditor extends EditorBase<CodeSpecification> {
// setup the editor concerning syntax highlighting and content assist
codeViewer.configure(getSourceViewerConfig());
// set code font
codeViewer.getTextWidget().setFont(new Font(Display.getCurrent(), getOSSpecificCodeFont()));
Font font = new Font(Display.getCurrent(), getOSSpecificCodeFont());
codeViewer.getTextWidget().setFont(font);
new UndoRedo(codeViewer.getTextWidget());
codeViewer.addTextListener(new ITextListener() {
@Override
......@@ -193,6 +196,13 @@ public class CodeSpecificationEditor extends EditorBase<CodeSpecification> {
}
}
});
codeViewer.getControl().addDisposeListener(new DisposeListener() {
/** {@inheritDoc} */
@Override
public void widgetDisposed(DisposeEvent e) {
font.dispose();
}
});
}
/**
......
DataDictionaryEditor.java 077b9614ffe8e977e45473a6019ed10e4c82e7f2 YELLOW
DataDictionaryEditorBinding.java 0afd69998e31b243361ecbbd6a4691f8ee72b3a9 GREEN
DataDictionaryEvaluatorBackend.java 8ac259f436097fdc51252be25ef7d134ae4a44ab GREEN
DataDictionaryEvaluatorBackend.java 02d1a65628734717908b5da0cce58a36fceaaa18 YELLOW
DataDictionaryEvaluatorBinding.java ed402d190105d8be10c1b126f98b3de447387033 GREEN
DataDictionaryTreeContentProvider.java 49d5f33a02ba8389f27a11f91130f97c2624208e GREEN
......@@ -24,6 +24,8 @@ import java.util.LinkedList;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.graphics.Font;
......@@ -111,7 +113,15 @@ public final class DataDictionaryEvaluatorBackend extends EditorBase<DataDiction
gui = new DataDictionaryEvaluatorGUI(parent, SWT.NONE);
evaluatorOutput = gui.getEvalOutputText();
evaluatorOutput.setFont(new Font(Display.getCurrent(), getOSSpecificCodeFont()));
Font font = new Font(Display.getCurrent(), getOSSpecificCodeFont());
evaluatorOutput.setFont(font);
evaluatorOutput.addDisposeListener(new DisposeListener() {
/** {@inheritDoc} */
@Override
public void widgetDisposed(DisposeEvent e) {
font.dispose();
}
});
evaluatorHelp = gui.getEvalInfoText();
evaluatorInput = gui.getEvalInputText();
......
Supports Markdown
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