Exemplo n.º 1
0
 private void setupDeleteHighlight(final JButton deleteHighlight) {
   deleteHighlight.setEnabled(model.getSelectedProfileSelectedHighlight().isPresent());
   deleteHighlight.addActionListener(
       l ->
           model
               .getSelectedProfileSelectedHighlight()
               .ifPresent(model::removeSelectedProfileHighlight));
 }
Exemplo n.º 2
0
 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()));
 }