@@ -94,17 +94,17 @@ public final class HTMLTextAreaSearchUtils {
94
94
95
95
// -----
96
96
// I18N String constants
97
- private static final ResourceBundle messages = ResourceBundle .getBundle ("org.graalvm.visualvm.lib.ui.swing .Bundle" ); // NOI18N
98
- // public static final String ACTION_FIND = messages.getString("SearchUtils_ActionFind "); // NOI18N
99
- // private static final String MSG_NODATA = messages.getString("SearchUtils_MsgNoData "); // NOI18N
100
- // private static final String MSG_NOTFOUND = messages.getString("SearchUtils_MsgNotFound "); // NOI18N
101
- private static final String SIDEBAR_CAPTION = messages .getString ("SearchUtils_SidebarCaption " ); // NOI18N
102
- private static final String BTN_PREVIOUS = messages .getString ("SearchUtils_BtnPrevious " ); // NOI18N
103
- private static final String BTN_PREVIOUS_TOOLTIP = messages .getString ("SearchUtils_BtnPreviousTooltip " ); // NOI18N
104
- private static final String BTN_NEXT = messages .getString ("SearchUtils_BtnNext " ); // NOI18N
105
- private static final String BTN_NEXT_TOOLTIP = messages .getString ("SearchUtils_BtnNextTooltip " ); // NOI18N
106
- private static final String BTN_MATCH_CASE_TOOLTIP = messages .getString ("SearchUtils_BtnMatchCaseTooltip " ); // NOI18N
107
- private static final String BTN_CLOSE_TOOLTIP = messages .getString ("SearchUtils_BtnCloseTooltip " ); // NOI18N
97
+ private static final ResourceBundle messages = ResourceBundle .getBundle ("org.graalvm.visualvm.lib.ui.components .Bundle" ); // NOI18N
98
+ private static final String MATCHES_PATTERN = messages .getString ("HTMLTextAreaSearchUtils_MatchesPattern " ); // NOI18N
99
+ private static final String NO_MATCHES = messages .getString ("HTMLTextAreaSearchUtils_NoMatches " ); // NOI18N
100
+ private static final String MATCHES_TOOLTIP = messages .getString ("HTMLTextAreaSearchUtils_MatchesTooltip " ); // NOI18N
101
+ private static final String SIDEBAR_CAPTION = messages .getString ("HTMLTextAreaSearchUtils_SidebarCaption " ); // NOI18N
102
+ private static final String BTN_PREVIOUS = messages .getString ("HTMLTextAreaSearchUtils_BtnPrevious " ); // NOI18N
103
+ private static final String BTN_PREVIOUS_TOOLTIP = messages .getString ("HTMLTextAreaSearchUtils_BtnPreviousTooltip " ); // NOI18N
104
+ private static final String BTN_NEXT = messages .getString ("HTMLTextAreaSearchUtils_BtnNext " ); // NOI18N
105
+ private static final String BTN_NEXT_TOOLTIP = messages .getString ("HTMLTextAreaSearchUtils_BtnNextTooltip " ); // NOI18N
106
+ private static final String BTN_MATCH_CASE_TOOLTIP = messages .getString ("HTMLTextAreaSearchUtils_BtnMatchCaseTooltip " ); // NOI18N
107
+ private static final String BTN_CLOSE_TOOLTIP = messages .getString ("HTMLTextAreaSearchUtils_BtnCloseTooltip " ); // NOI18N
108
108
// -----
109
109
110
110
public static final String FIND_ACTION_KEY = "find-action-key" ; // NOI18N
@@ -424,7 +424,7 @@ public void run() {
424
424
});
425
425
}
426
426
};
427
- highlightResults .setToolTipText ("Highlight matches" );
427
+ highlightResults .setToolTipText (MATCHES_TOOLTIP );
428
428
// NOTE: added below
429
429
430
430
final JButton prev = new JButton (BTN_PREVIOUS , Icons .getIcon (GeneralIcons .FIND_PREVIOUS )) {
@@ -446,7 +446,7 @@ public void run() {
446
446
int offset = result .getOffset (index );
447
447
area .select (offset , offset + search .length ());
448
448
} else {
449
- feedback .setText ("no matches" );
449
+ feedback .setText (NO_MATCHES );
450
450
area .select (area .getSelectionStart (), area .getSelectionStart ());
451
451
}
452
452
}
@@ -481,7 +481,7 @@ public void run() {
481
481
int offset = result .getOffset (index );
482
482
area .select (offset , offset + search .length ());
483
483
} else {
484
- feedback .setText ("no matches" );
484
+ feedback .setText (NO_MATCHES );
485
485
area .select (area .getSelectionStart (), area .getSelectionStart ());
486
486
}
487
487
}
@@ -593,7 +593,7 @@ private String getSearchString() {
593
593
594
594
private void setResultsFeedback (int index , int count , DocumentSearchResult result ) {
595
595
NumberFormat format = NumberFormat .getInstance ();
596
- feedback .setText (format .format (index + 1 ) + " of " + format .format (count ) + " matches" );
596
+ feedback .setText (MessageFormat . format ( MATCHES_PATTERN , format .format (index + 1 ), format .format (count )) );
597
597
598
598
if (result != null ) {
599
599
if (highlightResults .isSelected ()) result .highlightResults (area .getHighlighter ());
0 commit comments