aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDawid Pakuła2013-11-14 17:22:44 (EST)
committerGerrit Code Review @ Eclipse.org2013-12-02 12:39:55 (EST)
commit0d5a2066fc7bc267ffc40f021c3bdf3d5f9108cb (patch)
tree8621989a4a408a9eade543a13a9cb6c7270ccb4c
parent9b5fa205d50ffb9b84c762c477af7a2207218dfc (diff)
downloadorg.eclipse.pdt-0d5a2066fc7bc267ffc40f021c3bdf3d5f9108cb.zip
org.eclipse.pdt-0d5a2066fc7bc267ffc40f021c3bdf3d5f9108cb.tar.gz
org.eclipse.pdt-0d5a2066fc7bc267ffc40f021c3bdf3d5f9108cb.tar.bz2
Bug 421784 - Default background on syntax coloring and formatter preview always whiterefs/changes/13/18413/2
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=421784 Change-Id: I956671c594498b470c73403a8f2576570e519370 Signed-off-by: Dawid Pakuła <zulus@w3des.net>
-rw-r--r--plugins/org.eclipse.php.formatter.ui/src/org/eclipse/php/formatter/ui/preferences/PhpPreview.java12
-rw-r--r--plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/preferences/PHPSyntaxColoringPage.java11
2 files changed, 23 insertions, 0 deletions
diff --git a/plugins/org.eclipse.php.formatter.ui/src/org/eclipse/php/formatter/ui/preferences/PhpPreview.java b/plugins/org.eclipse.php.formatter.ui/src/org/eclipse/php/formatter/ui/preferences/PhpPreview.java
index 0796f57..b1311b1 100644
--- a/plugins/org.eclipse.php.formatter.ui/src/org/eclipse/php/formatter/ui/preferences/PhpPreview.java
+++ b/plugins/org.eclipse.php.formatter.ui/src/org/eclipse/php/formatter/ui/preferences/PhpPreview.java
@@ -16,6 +16,7 @@ import java.util.Collection;
import java.util.Iterator;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.php.formatter.core.CodeFormatterPreferences;
import org.eclipse.php.internal.core.documentModel.provisional.contenttype.ContentTypeIdForPHP;
@@ -23,9 +24,12 @@ import org.eclipse.php.internal.ui.editor.highlighter.LineStyleProviderForPhp;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.ui.internal.editors.text.EditorsPlugin;
+import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.ltk.parser.RegionParser;
import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
@@ -108,6 +112,14 @@ public abstract class PhpPreview {
return;
}
+ final IPreferenceStore editorStore = EditorsPlugin.getDefault()
+ .getPreferenceStore();
+ fText.setBackground(editorStore
+ .getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT) ? null
+ : new Color(fText.getDisplay(), PreferenceConverter.getColor(
+ editorStore,
+ AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND)));
+
fStyleProvider.loadColors();
IStructuredDocumentRegion node = fNodes;
diff --git a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/preferences/PHPSyntaxColoringPage.java b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/preferences/PHPSyntaxColoringPage.java
index 0621fa9..8f3e242 100644
--- a/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/preferences/PHPSyntaxColoringPage.java
+++ b/plugins/org.eclipse.php.ui/src/org/eclipse/php/internal/ui/preferences/PHPSyntaxColoringPage.java
@@ -25,6 +25,7 @@ import org.eclipse.dltk.core.ISourceModule;
import org.eclipse.dltk.ui.DLTKUIPlugin;
import org.eclipse.jface.preference.ColorSelector;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.text.BadLocationException;
@@ -66,6 +67,8 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.internal.editors.text.EditorsPlugin;
+import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.text.*;
import org.eclipse.wst.sse.ui.ISemanticHighlighting;
@@ -398,6 +401,14 @@ public final class PHPSyntaxColoringPage extends PreferencePage implements
fText.addSelectionListener(getTextSelectionListener());
fText.addMouseListener(getTextMouseListener());
fText.addTraverseListener(getTraverseListener());
+
+ final IPreferenceStore editorStore = EditorsPlugin.getDefault()
+ .getPreferenceStore();
+ fText.setBackground(editorStore
+ .getBoolean(AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT) ? null
+ : new Color(fText.getDisplay(), PreferenceConverter.getColor(
+ editorStore,
+ AbstractTextEditor.PREFERENCE_COLOR_BACKGROUND)));
setAccessible(fText, SSEUIMessages.Sample_text__UI_);
fDocument = StructuredModelManager.getModelManager()
.createStructuredDocumentFor(