/** * Rebuilds the menu according to the recent searches. */ private void buildMenu() { setVisible(false); removeAll(); if (recentSearches.getLength() == 0) { JMenuItem noRecent = new JMenuItem(UIManagerExt.getString("SearchField.noRecentsText")); noRecent.setEnabled(false); add(noRecent); } else { JMenuItem recent = new JMenuItem(UIManagerExt.getString("SearchField.recentsMenuTitle")); recent.setEnabled(false); add(recent); for (String searchString : recentSearches.getRecentSearches()) { JMenuItem mi = new JMenuItem(searchString); mi.addActionListener(this); add(mi); } addSeparator(); clear = new JMenuItem(UIManagerExt.getString("SearchField.clearRecentsText")); clear.addActionListener(this); add(clear); } }
/** * Rebuilds the menu according to the recent searches. */ private void buildMenu() { setVisible(false); removeAll(); if (recentSearches.getLength() == 0) { JMenuItem noRecent = new JMenuItem(UIManagerExt.getString("SearchField.noRecentsText")); noRecent.setEnabled(false); add(noRecent); } else { JMenuItem recent = new JMenuItem(UIManagerExt.getString("SearchField.recentsMenuTitle")); recent.setEnabled(false); add(recent); for (String searchString : recentSearches.getRecentSearches()) { JMenuItem mi = new JMenuItem(searchString); mi.addActionListener(this); add(mi); } addSeparator(); clear = new JMenuItem(UIManagerExt.getString("SearchField.clearRecentsText")); clear.addActionListener(this); add(clear); } }
/** * Rebuilds the menu according to the recent searches. */ private void buildMenu() { setVisible(false); removeAll(); if (recentSearches.getLength() == 0) { JMenuItem noRecent = new JMenuItem(UIManagerExt.getString("SearchField.noRecentsText")); noRecent.setEnabled(false); add(noRecent); } else { JMenuItem recent = new JMenuItem(UIManagerExt.getString("SearchField.recentsMenuTitle")); recent.setEnabled(false); add(recent); for (String searchString : recentSearches.getRecentSearches()) { JMenuItem mi = new JMenuItem(searchString); mi.addActionListener(this); add(mi); } addSeparator(); clear = new JMenuItem(UIManagerExt.getString("SearchField.clearRecentsText")); clear.addActionListener(this); add(clear); } }
/** * Rebuilds the menu according to the recent searches. */ private void buildMenu() { setVisible(false); removeAll(); if (recentSearches.getLength() == 0) { JMenuItem noRecent = new JMenuItem(UIManagerExt.getString("SearchField.noRecentsText")); noRecent.setEnabled(false); add(noRecent); } else { JMenuItem recent = new JMenuItem(UIManagerExt.getString("SearchField.recentsMenuTitle")); recent.setEnabled(false); add(recent); for (String searchString : recentSearches.getRecentSearches()) { JMenuItem mi = new JMenuItem(searchString); mi.addActionListener(this); add(mi); } addSeparator(); clear = new JMenuItem(UIManagerExt.getString("SearchField.clearRecentsText")); clear.addActionListener(this); add(clear); } }