Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2020-07-14 09:30:20 -0400
committerLars Vogel2020-07-31 05:52:08 -0400
commit961c1d1d50f0bd73b5dc3f2e5b37042c63b2ce32 (patch)
treeb37e568b72b1d8ad5ffa4ba0bb10125f53c40258
parent2098f96974e025c74abc2fd6214ef5e9e0912aee (diff)
downloadeclipse.platform.text-I20200801-1800.tar.gz
eclipse.platform.text-I20200801-1800.tar.xz
eclipse.platform.text-I20200801-1800.zip
As these calls are no longer needed, remove the calls and related code around such dispose that is also now redundant. Change-Id: Ifd82694346e546185768256eba526027f5bd9f4f
-rw-r--r--org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java14
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java14
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java68
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InfoForm.java1
4 files changed, 7 insertions, 90 deletions
diff --git a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java
index 17696de2b..414163c4c 100644
--- a/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java
+++ b/org.eclipse.jface.text/projection/org/eclipse/jface/text/source/projection/SourceViewerInformationControl.java
@@ -73,12 +73,6 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio
private Label fSeparator;
/** The font of the optional status text label.*/
private Font fStatusTextFont;
- /**
- * The color of the optional status text label or <code>null</code> if none.
- *
- * @since 3.6
- */
- private Color fStatusTextForegroundColor;
/** The maximal widget width. */
private int fMaxWidth;
/** The maximal widget height. */
@@ -173,8 +167,9 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio
GridData gd2= new GridData(GridData.FILL_VERTICAL | GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
fStatusField.setLayoutData(gd2);
- fStatusTextForegroundColor= new Color(fStatusField.getDisplay(), blend(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB(), display.getSystemColor(SWT.COLOR_INFO_FOREGROUND).getRGB(), 0.56f));
- fStatusField.setForeground(fStatusTextForegroundColor);
+ Color statusTextForegroundColor= new Color(fStatusField.getDisplay(),
+ blend(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB(), display.getSystemColor(SWT.COLOR_INFO_FOREGROUND).getRGB(), 0.56f));
+ fStatusField.setForeground(statusTextForegroundColor);
fStatusField.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
}
@@ -240,9 +235,6 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio
if (fStatusTextFont != null && !fStatusTextFont.isDisposed())
fStatusTextFont.dispose();
fStatusTextFont= null;
- if (fStatusTextForegroundColor != null && !fStatusTextForegroundColor.isDisposed())
- fStatusTextForegroundColor.dispose();
- fStatusTextForegroundColor= null;
fTextFont= null;
fShell= null;
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java
index 521ba4e01..7ab858a97 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/internal/texteditor/SourceViewerInformationControl.java
@@ -79,12 +79,6 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio
private Label fSeparator;
/** The font of the optional status text label.*/
private Font fStatusTextFont;
- /**
- * The color of the optional status text label or <code>null</code> if none.
- *
- * @since 3.6
- */
- private Color fStatusTextForegroundColor;
/** The maximal widget width. */
private int fMaxWidth;
/** The maximal widget height. */
@@ -182,8 +176,9 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio
GridData gd2= new GridData(GridData.FILL_VERTICAL | GridData.FILL_HORIZONTAL | GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.VERTICAL_ALIGN_BEGINNING);
fStatusField.setLayoutData(gd2);
- fStatusTextForegroundColor= new Color(fStatusField.getDisplay(), blend(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB(), display.getSystemColor(SWT.COLOR_INFO_FOREGROUND).getRGB(), 0.56f));
- fStatusField.setForeground(fStatusTextForegroundColor);
+ Color statusTextForegroundColor= new Color(fStatusField.getDisplay(),
+ blend(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB(), display.getSystemColor(SWT.COLOR_INFO_FOREGROUND).getRGB(), 0.56f));
+ fStatusField.setForeground(statusTextForegroundColor);
fStatusField.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
}
@@ -253,9 +248,6 @@ class SourceViewerInformationControl implements IInformationControl, IInformatio
if (fStatusTextFont != null && !fStatusTextFont.isDisposed())
fStatusTextFont.dispose();
fStatusTextFont= null;
- if (fStatusTextForegroundColor != null && !fStatusTextForegroundColor.isDisposed())
- fStatusTextForegroundColor.dispose();
- fStatusTextForegroundColor= null;
fTextFont= null;
fShell= null;
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
index 22b270c3f..3456447c3 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
@@ -2378,26 +2378,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
*/
private SelectionListener fSelectionListener;
/** The editor's font. */
- private Font fFont; /**
- * The editor's foreground color.
- * @since 2.0
- */
- private Color fForegroundColor;
- /**
- * The editor's background color.
- * @since 2.0
- */
- private Color fBackgroundColor;
- /**
- * The editor's selection foreground color.
- * @since 3.0
- */
- private Color fSelectionForegroundColor;
- /**
- * The editor's selection background color.
- * @since 3.0
- */
- private Color fSelectionBackgroundColor;
+ private Font fFont;
/**
* The find scope's highlight color.
* @since 2.0
@@ -3932,32 +3913,18 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
: createColor(store, PREFERENCE_COLOR_FOREGROUND, styledText.getDisplay());
styledText.setForeground(color);
- if (fForegroundColor != null)
- fForegroundColor.dispose();
-
- fForegroundColor= color;
-
// ---------- background color ----------------------
color= store.getBoolean(PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT)
? null
: createColor(store, PREFERENCE_COLOR_BACKGROUND, styledText.getDisplay());
styledText.setBackground(color);
- if (fBackgroundColor != null)
- fBackgroundColor.dispose();
-
- fBackgroundColor= color;
-
// ----------- selection foreground color --------------------
color= store.getBoolean(PREFERENCE_COLOR_SELECTION_FOREGROUND_SYSTEM_DEFAULT)
? null
: createColor(store, PREFERENCE_COLOR_SELECTION_FOREGROUND, styledText.getDisplay());
styledText.setSelectionForeground(color);
- if (fSelectionForegroundColor != null)
- fSelectionForegroundColor.dispose();
-
- fSelectionForegroundColor= color;
// ---------- selection background color ----------------------
color= store.getBoolean(PREFERENCE_COLOR_SELECTION_BACKGROUND_SYSTEM_DEFAULT)
@@ -3965,10 +3932,6 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
: createColor(store, PREFERENCE_COLOR_SELECTION_BACKGROUND, styledText.getDisplay());
styledText.setSelectionBackground(color);
- if (fSelectionBackgroundColor != null)
- fSelectionBackgroundColor.dispose();
-
- fSelectionBackgroundColor= color;
}
}
@@ -3992,10 +3955,6 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
if (target != null && target instanceof IFindReplaceTargetExtension)
((IFindReplaceTargetExtension) target).setScopeHighlightColor(color);
- if (fFindScopeHighlightColor != null)
- fFindScopeHighlightColor.dispose();
-
- fFindScopeHighlightColor= color;
}
}
@@ -4335,31 +4294,6 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
disposeNonDefaultCaret();
fInitialCaret= null;
- if (fForegroundColor != null) {
- fForegroundColor.dispose();
- fForegroundColor= null;
- }
-
- if (fBackgroundColor != null) {
- fBackgroundColor.dispose();
- fBackgroundColor= null;
- }
-
- if (fSelectionForegroundColor != null) {
- fSelectionForegroundColor.dispose();
- fSelectionForegroundColor= null;
- }
-
- if (fSelectionBackgroundColor != null) {
- fSelectionBackgroundColor.dispose();
- fSelectionBackgroundColor= null;
- }
-
- if (fFindScopeHighlightColor != null) {
- fFindScopeHighlightColor.dispose();
- fFindScopeHighlightColor= null;
- }
-
if (fFontPropertyChangeListener != null) {
JFaceResources.getFontRegistry().removeListener(fFontPropertyChangeListener);
if (fPreferenceStore != null)
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InfoForm.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InfoForm.java
index 6d4a5322c..99da27488 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InfoForm.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InfoForm.java
@@ -80,7 +80,6 @@ public class InfoForm {
fScrolledComposite.addDisposeListener(e -> {
JFaceResources.getFontRegistry().removeListener(fPropertyChangeListener);
fScrolledComposite = null;
- fSeparatorColor.dispose();
fSeparatorColor = null;
fHeader = null;
fBanner = null;

Back to the top