[NiConsole] Ensure that sash in console page is discoverable
Change-Id: I3d26efa6fa99f45773a278fd17913718c58dd707
diff --git a/r/org.eclipse.statet.nico.ui/src/org/eclipse/statet/nico/ui/console/NIConsolePage.java b/r/org.eclipse.statet.nico.ui/src/org/eclipse/statet/nico/ui/console/NIConsolePage.java
index e42182e..f326a14 100644
--- a/r/org.eclipse.statet.nico.ui/src/org/eclipse/statet/nico/ui/console/NIConsolePage.java
+++ b/r/org.eclipse.statet.nico.ui/src/org/eclipse/statet/nico/ui/console/NIConsolePage.java
@@ -52,6 +52,7 @@
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocumentListener;
import org.eclipse.jface.text.IFindReplaceTarget;
+import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
@@ -66,6 +67,7 @@
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
@@ -524,8 +526,6 @@
final GridData outputGD= new GridData(SWT.FILL, SWT.FILL, true, true);
this.outputViewer.getControl().setLayoutData(outputGD);
- new TextViewerEditorColorUpdater(this.outputViewer, EditorsUI.getPreferenceStore());
-
this.outputViewer.getTextWidget().addKeyListener(new KeyListener() {
@Override
public void keyPressed(final KeyEvent e) {
@@ -557,6 +557,23 @@
// sash.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW));
sash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ new TextViewerEditorColorUpdater(this.outputViewer, EditorsUI.getPreferenceStore()) {
+ @Override
+ protected void update(final ISourceViewer viewer, final StyledText styledText) {
+ super.update(viewer, styledText);
+
+ sash.setBackground(null);
+ final Color outputBackground= styledText.getBackground();
+ if (outputBackground.equals(sash.getBackground())) {
+ Color altColor= styledText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND);
+ if (outputBackground.equals(altColor)) {
+ altColor= styledText.getDisplay().getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW);
+ }
+ sash.setBackground(altColor);
+ }
+ }
+ };
+
this.inputEditor.createControl(this.control, createInputEditorConfigurator());
final GridData inputGD= new GridData(SWT.FILL, SWT.FILL, true, false);
this.inputEditor.getComposite().setLayoutData(inputGD);