Merge pull request #2326 from DevCharly/flatlaf-tasks-background-fix
[NETBEANS-4627] FlatLaf: fix wrong background color of search result table in Find Tasks Editor
diff --git a/ide/editor.search/src/org/netbeans/modules/editor/search/SearchComboBoxEditor.java b/ide/editor.search/src/org/netbeans/modules/editor/search/SearchComboBoxEditor.java
index 45d303f..1edb26d 100644
--- a/ide/editor.search/src/org/netbeans/modules/editor/search/SearchComboBoxEditor.java
+++ b/ide/editor.search/src/org/netbeans/modules/editor/search/SearchComboBoxEditor.java
@@ -127,17 +127,16 @@
// selection is not removed when text is input via IME
// so, just remove it when the caret is changed
if ("caret".equals(evt.getPropertyName())) { // NOI18N
- if (evt.getOldValue() instanceof Caret) {
+ if (evt.getOldValue() instanceof Caret
+ && evt.getNewValue() instanceof Caret) { // NETBEANS-4620 check new value is not null but Caret
Caret oldCaret = (Caret) evt.getOldValue();
- if (oldCaret != null) {
- int dotPosition = oldCaret.getDot();
- int markPosition = oldCaret.getMark();
- if (dotPosition != markPosition) {
- try {
- editorPane.getDocument().remove(Math.min(markPosition, dotPosition), Math.abs(markPosition - dotPosition));
- } catch (BadLocationException ex) {
- LOG.log(Level.WARNING, "Invalid removal offset: {0}", ex.offsetRequested()); // NOI18N
- }
+ int dotPosition = oldCaret.getDot();
+ int markPosition = oldCaret.getMark();
+ if (dotPosition != markPosition) {
+ try {
+ editorPane.getDocument().remove(Math.min(markPosition, dotPosition), Math.abs(markPosition - dotPosition));
+ } catch (BadLocationException ex) {
+ LOG.log(Level.WARNING, "Invalid removal offset: {0}", ex.offsetRequested()); // NOI18N
}
}
}
@@ -412,4 +411,4 @@
return originalActionName;
}
};
-}
\ No newline at end of file
+}
diff --git a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatDarkLaf.properties b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatDarkLaf.properties
index 6ca7880..9fef193 100644
--- a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatDarkLaf.properties
+++ b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatDarkLaf.properties
@@ -161,6 +161,7 @@
# output
nb.output.foreground=@foreground
nb.output.backgorund=#2B2B2B
+nb.output.selectionBackground=#214283
nb.output.err.foreground=#FF4040
nb.output.input=#CC7832
nb.output.link.foreground=$Component.linkColor
diff --git a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLightLaf.properties b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLightLaf.properties
index 1df4cff..b6839b6 100644
--- a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLightLaf.properties
+++ b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLightLaf.properties
@@ -70,3 +70,6 @@
# QuickSearch
nb.quicksearch.border=1,1,1,1,@background
+
+# output
+nb.output.selectionBackground=#89BCED