Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
ec0ab2b5
Commit
ec0ab2b5
authored
Mar 28, 2018
by
Simon Barner
Browse files
Avoid leakage of Font resources.
refs 2709
parent
054f6a75
Changes
4
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.component.ui/trunk/src/org/fortiss/af3/component/ui/editor/.ratings
View file @
ec0ab2b5
CodeSpecificationEditor.java
461d9b6668dfeeb0debd34e9f725d49cc8bbbea2
RED
CodeSpecificationEditor.java
7afe41a1f3aaa983c223d62a434fb89bec31baa8
RED
CodeSpecificationEditorBinding.java a0cff3224d8d0755e948188c2480e528c82eb590 GREEN
CodeSpecificationEditorBinding.java a0cff3224d8d0755e948188c2480e528c82eb590 GREEN
ComponentArchitectureEditorBinding.java 262e86525dda985d7baaee6a90150d34389b34ca GREEN
ComponentArchitectureEditorBinding.java 262e86525dda985d7baaee6a90150d34389b34ca GREEN
ComponentStructureEditor.java 11aee03b8db78a93a7704a8b8240b84a6d192012 GREEN
ComponentStructureEditor.java 11aee03b8db78a93a7704a8b8240b84a6d192012 GREEN
...
...
org.fortiss.af3.component.ui/trunk/src/org/fortiss/af3/component/ui/editor/CodeSpecificationEditor.java
View file @
ec0ab2b5
...
@@ -41,6 +41,8 @@ import org.eclipse.jface.text.source.SourceViewerConfiguration;
...
@@ -41,6 +41,8 @@ import org.eclipse.jface.text.source.SourceViewerConfiguration;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.custom.ST
;
import
org.eclipse.swt.custom.ST
;
import
org.eclipse.swt.custom.StyledText
;
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.SelectionAdapter
;
import
org.eclipse.swt.events.SelectionEvent
;
import
org.eclipse.swt.events.SelectionEvent
;
import
org.eclipse.swt.graphics.Font
;
import
org.eclipse.swt.graphics.Font
;
...
@@ -183,7 +185,8 @@ public class CodeSpecificationEditor extends EditorBase<CodeSpecification> {
...
@@ -183,7 +185,8 @@ public class CodeSpecificationEditor extends EditorBase<CodeSpecification> {
// setup the editor concerning syntax highlighting and content assist
// setup the editor concerning syntax highlighting and content assist
codeViewer
.
configure
(
getSourceViewerConfig
());
codeViewer
.
configure
(
getSourceViewerConfig
());
// set code font
// 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
());
new
UndoRedo
(
codeViewer
.
getTextWidget
());
codeViewer
.
addTextListener
(
new
ITextListener
()
{
codeViewer
.
addTextListener
(
new
ITextListener
()
{
@Override
@Override
...
@@ -193,6 +196,13 @@ public class CodeSpecificationEditor extends EditorBase<CodeSpecification> {
...
@@ -193,6 +196,13 @@ public class CodeSpecificationEditor extends EditorBase<CodeSpecification> {
}
}
}
}
});
});
codeViewer
.
getControl
().
addDisposeListener
(
new
DisposeListener
()
{
/** {@inheritDoc} */
@Override
public
void
widgetDisposed
(
DisposeEvent
e
)
{
font
.
dispose
();
}
});
}
}
/**
/**
...
...
org.fortiss.af3.expression.ui/trunk/src/org/fortiss/af3/expression/ui/editor/.ratings
View file @
ec0ab2b5
DataDictionaryEditor.java 077b9614ffe8e977e45473a6019ed10e4c82e7f2 YELLOW
DataDictionaryEditor.java 077b9614ffe8e977e45473a6019ed10e4c82e7f2 YELLOW
DataDictionaryEditorBinding.java 0afd69998e31b243361ecbbd6a4691f8ee72b3a9 GREEN
DataDictionaryEditorBinding.java 0afd69998e31b243361ecbbd6a4691f8ee72b3a9 GREEN
DataDictionaryEvaluatorBackend.java
8ac259f436097fdc51252be25ef7d134ae4a44ab GREEN
DataDictionaryEvaluatorBackend.java
02d1a65628734717908b5da0cce58a36fceaaa18 YELLOW
DataDictionaryEvaluatorBinding.java ed402d190105d8be10c1b126f98b3de447387033 GREEN
DataDictionaryEvaluatorBinding.java ed402d190105d8be10c1b126f98b3de447387033 GREEN
DataDictionaryTreeContentProvider.java 49d5f33a02ba8389f27a11f91130f97c2624208e GREEN
DataDictionaryTreeContentProvider.java 49d5f33a02ba8389f27a11f91130f97c2624208e GREEN
org.fortiss.af3.expression.ui/trunk/src/org/fortiss/af3/expression/ui/editor/DataDictionaryEvaluatorBackend.java
View file @
ec0ab2b5
...
@@ -24,6 +24,8 @@ import java.util.LinkedList;
...
@@ -24,6 +24,8 @@ import java.util.LinkedList;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.custom.StyledText
;
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.KeyAdapter
;
import
org.eclipse.swt.events.KeyEvent
;
import
org.eclipse.swt.events.KeyEvent
;
import
org.eclipse.swt.graphics.Font
;
import
org.eclipse.swt.graphics.Font
;
...
@@ -111,7 +113,15 @@ public final class DataDictionaryEvaluatorBackend extends EditorBase<DataDiction
...
@@ -111,7 +113,15 @@ public final class DataDictionaryEvaluatorBackend extends EditorBase<DataDiction
gui
=
new
DataDictionaryEvaluatorGUI
(
parent
,
SWT
.
NONE
);
gui
=
new
DataDictionaryEvaluatorGUI
(
parent
,
SWT
.
NONE
);
evaluatorOutput
=
gui
.
getEvalOutputText
();
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
();
evaluatorHelp
=
gui
.
getEvalInfoText
();
evaluatorInput
=
gui
.
getEvalInputText
();
evaluatorInput
=
gui
.
getEvalInputText
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment