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:
Karl Tauber
2021-08-27 22:53:04 +02:00
parent a6d318a197
commit 968e508bb5
2 changed files with 6 additions and 1 deletions

View File

@@ -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 ) {

View File

@@ -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(),