private void setupDeleteHighlight(final JButton deleteHighlight) { deleteHighlight.setEnabled(model.getSelectedProfileSelectedHighlight().isPresent()); deleteHighlight.addActionListener( l -> model .getSelectedProfileSelectedHighlight() .ifPresent(model::removeSelectedProfileHighlight)); }
private void setupEditHighlight(final JButton editHighlight) { editHighlight.setEnabled(model.getSelectedProfileSelectedHighlight().isPresent()); editHighlight.addActionListener( l -> model .getSelectedProfileSelectedHighlight() .ifPresent( (String oldName) -> new StandardInputDialog( dialog, Dialog.ModalityType.DOCUMENT_MODAL, iconManager, "Profile Manager: Edit Highlight", "Enter new highlight", model.getSelectedProfileEditHighlightValidator(), (String newName) -> model.editSelectedProfileHighlight(oldName, newName)) .display())); }