refactoring

This commit is contained in:
rusefi 2021-10-10 19:35:30 -04:00
parent d0c5af2eef
commit de3e5d1d0a
1 changed files with 5 additions and 1 deletions

View File

@ -155,7 +155,7 @@ public class RecentCommands {
} }
public void add(String command) { public void add(String command) {
if (command.startsWith(getSetCommand(CMD_DATE))) { if (isBoringCommand(command)) {
// not useful to remember this one // not useful to remember this one
return; return;
} }
@ -198,6 +198,10 @@ public class RecentCommands {
getConfig().getRoot().setProperty(KEY, pack()); getConfig().getRoot().setProperty(KEY, pack());
} }
private static boolean isBoringCommand(String command) {
return command.startsWith(getSetCommand(CMD_DATE));
}
public static JComponent createButton(UIContext uiContext, final AtomicBoolean reentrant, final String command) { public static JComponent createButton(UIContext uiContext, final AtomicBoolean reentrant, final String command) {
JButton button = new JButton(command); JButton button = new JButton(command);
Icon icon = COMMAND_ICONS.get(command); Icon icon = COMMAND_ICONS.get(command);