package sc.iview.commands.help;


import org.scijava.command.Command;
import org.scijava.plugin.Menu;
import org.scijava.plugin.Parameter;
import org.scijava.plugin.Plugin;
import org.scijava.ui.UIService;
import org.scijava.ui.behaviour.InputTrigger;
import sc.iview.SciView;

import static sc.iview.commands.MenuWeights.HELP;
import static sc.iview.commands.MenuWeights.HELP_HELP;
import static sc.iview.commands.view.NodePropertyEditor.USAGE_TEXT;

@Plugin(type = Command.class, menuRoot = "SciView", //
        menu = { @Menu(label = "Help", weight = HELP), //
                 @Menu(label = "Help", weight = HELP_HELP) })
public class Help implements Command {

    @Parameter
    private SciView sciView;

    @Parameter
    private UIService uiService;

    public String getKeybinds() {
        String helpString = "";
        for( InputTrigger trigger : sciView.getSceneryInputHandler().getAllBindings().keySet() ) {
            helpString += trigger + "\t-\t" + sciView.getSceneryInputHandler().getAllBindings().get( trigger ) + "\n";
        }
        return helpString;
    }

    @Override
    public void run() {
        uiService.showDialog( "<html>" + USAGE_TEXT + "<br><br>" + getKeybinds() + "", "SciView Usage");
    }
}

@@ -802,16 +802,23 @@
   String
+Builder
  helpStr
@@ -823,18 +823,35 @@
 tring = 
-%22%22
+new StringBuilder()
 ;%0A      
@@ -969,32 +969,48 @@
 ring
- += trigger + %22%5Ct-%5Ct%22 + 
+.append(trigger).append(%22%5Ct-%5Ct%22).append(
 sciV
@@ -1063,25 +1063,30 @@
 get(
- 
 trigger
- ) + 
+)).append(
 %22%5Cn%22
+)
 ;%0A  
@@ -1118,16 +1118,27 @@
 lpString
+.toString()
 ;%0A    %7D%0A

Switch to StringBuilder in Help