private ActionEvent getCommandActionEvent(ActionEvent e) { CustomCommand command = commands.get(e.getActionCommand()); if (command != null) { return new CommandActionEvent(e, command); } return e; }
private void customCommand(Room room, ActionEvent e, Parameters parameters) { CommandActionEvent ce = (CommandActionEvent)e; CustomCommand command = ce.getCommand(); client.anonCustomCommand(room, command, parameters); }
@Override public void actionPerformed(ActionEvent e) { if (e.getActionCommand().equals("errors")) { GuiUtil.showNonModalMessage(getInvoker(), "Errors", errorsInfo, JOptionPane.WARNING_MESSAGE, true); } if (e instanceof CommandActionEvent) { CustomCommand command = ((CommandActionEvent)e).getCommand(); CommandSettings.showCommandInfoPopup(getInvoker(), command); } }