private SingleCmdTool(String name, Terminal terminal, NamedCommand command) {
   super(
       CliToolConfig.config(name, SingleCmdTool.class)
           .cmds(cmd(command.name, command.getClass()))
           .build(),
       terminal);
   this.command = command;
 }
  private void computeAttatchCommand(XamlAttribute parent, FormAttachment attachment) {
    XamlElement attachmentChild = parent.getChild("FormAttachment", IConstants.XWT_NAMESPACE);
    if (attachmentChild == null) {
      attachmentChild =
          XamlFactory.eINSTANCE.createElement("FormAttachment", IConstants.XWT_NAMESPACE);
    }
    Control control = attachment.control;
    if (control != null) {
      String controlName = getName(control);
      if (controlName == null) {
        controlName = NamedCommand.generateName(control);
        addCommand(new NamedCommand(control, controlName));
      }
      XamlAttribute controlAttr = attachmentChild.getAttribute("control", IConstants.XWT_NAMESPACE);
      if (controlAttr == null) {
        controlAttr = XamlFactory.eINSTANCE.createAttribute("control", IConstants.XWT_NAMESPACE);
      }
      XamlElement bindChild = controlAttr.getChild("Binding", IConstants.XWT_NAMESPACE);
      if (bindChild == null) {
        bindChild = XamlFactory.eINSTANCE.createElement("Binding", IConstants.XWT_NAMESPACE);
      }
      ApplyAttributeSettingCommand command =
          new ApplyAttributeSettingCommand(
              bindChild, "ElementName", IConstants.XWT_NAMESPACE, controlName);
      addCommand(command);

      addNewChild(controlAttr, bindChild);
      addNewChild(attachmentChild, controlAttr);

      /* if (attachment.alignment != SWT.DEFAULT) */ {
        String alignment = "SWT.DEFAULT";
        switch (attachment.alignment) {
          case SWT.TOP:
            alignment = "SWT.TOP";
            break;
          case SWT.BOTTOM:
            alignment = "SWT.BOTTOM";
            break;
          case SWT.RIGHT:
            alignment = "SWT.RIGHT";
            break;
          case SWT.CENTER:
            alignment = "SWT.CENTER";
            break;
          case SWT.LEFT:
            alignment = "SWT.LEFT";
            break;
        }
        command =
            new ApplyAttributeSettingCommand(
                attachmentChild, "alignment", IConstants.XWT_NAMESPACE, alignment);
        addCommand(command);
      }
    } else {
      addCommand(new DeleteCommand(attachmentChild.getAttribute("control")));
    }
    /* if (attachment.denominator != 100) */ {
      ApplyAttributeSettingCommand command =
          new ApplyAttributeSettingCommand(
              attachmentChild,
              "denominator",
              IConstants.XWT_NAMESPACE,
              Integer.toString(attachment.denominator));
      addCommand(command);
    }
    /* if (attachment.numerator != 0) */ {
      ApplyAttributeSettingCommand command =
          new ApplyAttributeSettingCommand(
              attachmentChild,
              "numerator",
              IConstants.XWT_NAMESPACE,
              Integer.toString(attachment.numerator));
      addCommand(command);
    }
    /* if (attachment.offset != 0) */ {
      ApplyAttributeSettingCommand command =
          new ApplyAttributeSettingCommand(
              attachmentChild,
              "offset",
              IConstants.XWT_NAMESPACE,
              Integer.toString(attachment.offset));
      addCommand(command);
    }
    addNewChild(parent, attachmentChild);
  }