mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-11 06:27:13 -06:00
Theme Editor:
- change border color of find field to red if noting found/matches - update search match highlighting after reloading file on external change
This commit is contained in:
@@ -133,7 +133,7 @@ class FlatFindReplaceBar
|
|||||||
findOrMarkAll( true );
|
findOrMarkAll( true );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void markAll() {
|
void markAll() {
|
||||||
findOrMarkAll( false );
|
findOrMarkAll( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,6 +227,8 @@ class FlatFindReplaceBar
|
|||||||
private void updateMatchesLabel( SearchResult result, boolean replace ) {
|
private void updateMatchesLabel( SearchResult result, boolean replace ) {
|
||||||
matchesLabel.setText( result.getMarkedCount() + " matches" );
|
matchesLabel.setText( result.getMarkedCount() + " matches" );
|
||||||
replaceMatchesLabel.setText( replace ? result.getCount() + " matches replaced" : null );
|
replaceMatchesLabel.setText( replace ? result.getCount() + " matches replaced" : null );
|
||||||
|
|
||||||
|
findField.setOutline( result.getMarkedCount() > 0 ? null : "error" );
|
||||||
}
|
}
|
||||||
|
|
||||||
private void notifyEditorAction( String actionKey ) {
|
private void notifyEditorAction( String actionKey ) {
|
||||||
|
|||||||
@@ -224,6 +224,9 @@ class FlatThemeEditorPane
|
|||||||
textArea.reload();
|
textArea.reload();
|
||||||
|
|
||||||
textArea.select( selectionStart, selectionEnd );
|
textArea.select( selectionStart, selectionEnd );
|
||||||
|
|
||||||
|
if( findReplaceBar != null && findReplaceBar.isShowing() )
|
||||||
|
findReplaceBar.markAll();
|
||||||
} catch( IOException ex ) {
|
} catch( IOException ex ) {
|
||||||
JOptionPane.showMessageDialog( this,
|
JOptionPane.showMessageDialog( this,
|
||||||
"Failed to reload '" + textArea.getFileName() + "'\n\nReason: " + ex.getMessage(),
|
"Failed to reload '" + textArea.getFileName() + "'\n\nReason: " + ex.getMessage(),
|
||||||
|
|||||||
Reference in New Issue
Block a user