Merge branch 'develop' into features/r2_11_2_alphafold/JAL-2349_JAL-3855
[jalview.git] / src / jalview / gui / AnnotationLabels.java
index 2c563f1..804ab7b 100755 (executable)
@@ -292,25 +292,21 @@ public class AnnotationLabels extends JPanel
     EditNameDialog dialog = new EditNameDialog(annotation.label,
             annotation.description, name, description);
 
-    dialog.showDialog(ap.alignFrame, title, new Runnable()
-    {
-      @Override
-      public void run()
+    dialog.showDialog(ap.alignFrame, title, () -> {
+      annotation.label = dialog.getName();
+      String text = dialog.getDescription();
+      if (text != null && text.length() == 0)
       {
-        annotation.label = dialog.getName();
-        String text = dialog.getDescription();
-        if (text != null && text.length() == 0)
-        {
-          text = null;
-        }
-        annotation.description = text;
-        if (addNew)
-        {
-          ap.av.getAlignment().addAnnotation(annotation);
-          ap.av.getAlignment().setAnnotationIndex(annotation, 0);
-        }
-        ap.refresh(true);
+        text = null;
+      }
+      annotation.description = text;
+      if (addNew)
+      {
+        ap.av.getAlignment().addAnnotation(annotation);
+        ap.av.getAlignment().setAnnotationIndex(annotation, 0);
       }
+      ap.refresh(true);
+      return null;
     });
   }