protected void buttonClicked(Button btn) { if (btn.equals(recordButton)) { recording = !recording; updateRecordButton(); } if (btn.equals(doneButton)) { item.setTitle(commandText.getText()); if (!item.getTitle().equals("") && item.getKey() != -1) { SimpleKeyBindingManager manager = (SimpleKeyBindingManager) SpoutClient.getInstance().getKeyBindingManager(); manager.unregisterShortcut(item); manager.registerShortcut(item); } mc.displayGuiScreen(parent); parent.getModel().refresh(); } if (btn.equals(addButton)) { editCommand(-1); } if (btn.equals(editButton)) { editCommand(slot.getSelectedRow()); } if (btn.equals(removeButton)) { item.removeCommand(slot.getSelectedRow()); slot.updateItems(); updateButtons(); } }
public void updateButtons() { editButton.setEnabled(slot.getSelectedRow() != -1); removeButton.setEnabled(slot.getSelectedRow() != -1); }