File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed
heapviewer/src/org/graalvm/visualvm/heapviewer/ui
libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/components Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 36
36
import java .util .Collection ;
37
37
import java .util .Objects ;
38
38
import java .util .concurrent .ExecutionException ;
39
+ import javax .swing .Action ;
39
40
import javax .swing .BorderFactory ;
40
41
import javax .swing .JComponent ;
42
+ import javax .swing .JMenuItem ;
41
43
import javax .swing .JPanel ;
42
44
import javax .swing .JPopupMenu ;
43
45
import javax .swing .SwingUtilities ;
@@ -219,6 +221,12 @@ protected void populatePopup(JPopupMenu popup) {
219
221
if (popup .getComponentCount () > 0 ) popup .addSeparator ();
220
222
popup .add (createCopyMenuItem ());
221
223
popup .add (createSelectAllMenuItem ());
224
+
225
+ Action find = getActionMap ().get (HTMLTextAreaSearchUtils .FIND_ACTION_KEY );
226
+ if (find != null ) {
227
+ popup .addSeparator ();
228
+ popup .add (new JMenuItem (find ));
229
+ }
222
230
}
223
231
};
224
232
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ HTMLTextArea_PasteString=Paste
61
61
HTMLTextArea_DeleteString =Delete
62
62
HTMLTextArea_SelectAllString =Select All
63
63
64
+ HTMLTextAreaSearchUtils_FindActionName =Find
64
65
HTMLTextAreaSearchUtils_MatchesPattern ={0} of {1} matches
65
66
HTMLTextAreaSearchUtils_NoMatches =no matches
66
67
HTMLTextAreaSearchUtils_MatchesTooltip =Highlight matches
Original file line number Diff line number Diff line change @@ -780,6 +780,12 @@ protected void populatePopup(JPopupMenu popup) {
780
780
popup .add (createDeleteMenuItem ());
781
781
popup .addSeparator ();
782
782
popup .add (createSelectAllMenuItem ());
783
+
784
+ Action find = getActionMap ().get (HTMLTextAreaSearchUtils .FIND_ACTION_KEY );
785
+ if (find != null ) {
786
+ popup .addSeparator ();
787
+ popup .add (new JMenuItem (find ));
788
+ }
783
789
}
784
790
785
791
protected JMenuItem createCutMenuItem () {
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ public final class HTMLTextAreaSearchUtils {
95
95
// -----
96
96
// I18N String constants
97
97
private static final ResourceBundle messages = ResourceBundle .getBundle ("org.graalvm.visualvm.lib.ui.components.Bundle" ); // NOI18N
98
+ private static final String FIND_ACTION_NAME = messages .getString ("HTMLTextAreaSearchUtils_FindActionName" ); // NOI18N
98
99
private static final String MATCHES_PATTERN = messages .getString ("HTMLTextAreaSearchUtils_MatchesPattern" ); // NOI18N
99
100
private static final String NO_MATCHES = messages .getString ("HTMLTextAreaSearchUtils_NoMatches" ); // NOI18N
100
101
private static final String MATCHES_TOOLTIP = messages .getString ("HTMLTextAreaSearchUtils_MatchesTooltip" ); // NOI18N
@@ -641,7 +642,7 @@ public static void enableSearchActions(final HTMLTextArea area) {
641
642
ActionMap actionMapArea = area .getActionMap ();
642
643
InputMap inputMapArea = area .getInputMap ();
643
644
644
- Action findAction = new AbstractAction () {
645
+ Action findAction = new AbstractAction (FIND_ACTION_NAME ) {
645
646
public void actionPerformed (ActionEvent e ) {
646
647
SwingUtilities .invokeLater (new Runnable () {
647
648
public void run () {
You can’t perform that action at this time.
0 commit comments