JAL-3878 Add fullName to BaseAction class which combines service and action name
authorMateusz Warowny <mmzwarowny@dundee.ac.uk>
Tue, 5 Apr 2022 12:14:00 +0000 (14:14 +0200)
committerMateusz Warowny <mmzwarowny@dundee.ac.uk>
Tue, 5 Apr 2022 12:14:00 +0000 (14:14 +0200)
src/jalview/ws2/actions/BaseAction.java

index 97cf6fa..106937b 100644 (file)
@@ -139,6 +139,20 @@ public abstract class BaseAction<R> implements ActionI<R>
     return name;
   }
 
+  /**
+   * Returns a full name of the action which comprises of the service name and
+   * the action name if present.
+   * 
+   * @return full name of this action
+   */
+  public String getFullName()
+  {
+    if (name == null || name.isEmpty())
+      return webService.getName();
+    else
+      return webService.getName() + " " + name;
+  }
+
   @Override
   public String getTooltip()
   {