Examples of StringArgument


Examples of com.lowagie.tools.arguments.StringArgument

     * @param name the name of the argument
     * @return the value of an argument as an Object.
     * @throws InstantiationException
     */
    public Object getValue(String name) throws InstantiationException {
    StringArgument argument;
    for (Iterator i = arguments.iterator(); i.hasNext(); ) {
      argument = (StringArgument) i.next();
      if (name.equals(argument.getName())) {
        return argument.getArgument();
      }
    }
    return null;
  }
View Full Code Here

Examples of com.lowagie.tools.arguments.StringArgument

    menubar.add(tool);
    if (!arguments.isEmpty()) {
      JMenu params = new JMenu(ARGUMENTS);
      tool.setMnemonic(KeyEvent.VK_T);
      JMenuItem item;
      StringArgument argument;
      for (Iterator i = arguments.iterator(); i.hasNext(); ) {
        argument = (StringArgument)i.next();
        item = new JMenuItem(argument.getName());
        item.setToolTipText(argument.getDescription());
        item.addActionListener(argument);
        params.add(item);
      }
      menubar.add(params);
    }
View Full Code Here

Examples of com.lowagie.tools.arguments.StringArgument

   * @return a String describing how to use the tool.
   */
  public String getUsage() {
    StringBuffer buf = new StringBuffer("java ");
    buf.append(getClass().getName());
    StringArgument argument;
    for (Iterator i = arguments.iterator(); i.hasNext(); ) {
      argument = (StringArgument) i.next();
      buf.append(' ');
      buf.append(argument.getName());
    }
    buf.append('\n');
    for (Iterator i = arguments.iterator(); i.hasNext(); ) {
      argument = (StringArgument) i.next();
      buf.append(argument.getUsage());
    }
    return buf.toString();
  }
View Full Code Here

Examples of com.lowagie.tools.arguments.StringArgument

   * Gets the current arguments of the tool.
   * @return a String with the list of arguments and their values.
   */
  private String getArgs() {
    StringBuffer buf = new StringBuffer("Current arguments:\n");
    StringArgument argument;
    for (Iterator i = arguments.iterator(); i.hasNext(); ) {
      argument = (StringArgument) i.next();
      buf.append("  ");
      buf.append(argument.getName());
      if (argument.getValue() == null) {
        buf.append(" = null\n");
      }
      else {
        buf.append(" = '");
        buf.append(argument.getValue());
        buf.append("'\n");
      }
    }
    return buf.toString();
  }
View Full Code Here

Examples of com.lowagie.tools.arguments.StringArgument

   * Constructs an Decrypt object.
   */
  public Decrypt() {
    arguments.add(new FileArgument(this, "srcfile", "The file you want to decrypt", false, new PdfFilter()));
    arguments.add(new FileArgument(this, "destfile", "The file to which the decrypted PDF has to be written", true, new PdfFilter()));
    arguments.add(new StringArgument(this, "ownerpassword", "The ownerpassword you want to add to the PDF file", String.class.getName()));
  }
View Full Code Here

Examples of com.lowagie.tools.arguments.StringArgument

    super();
    FileArgument inputfile = new FileArgument(this, "srcfile",
                                   "The file you want to watermark", false,
                                   new PdfFilter());
    arguments.add(inputfile);
    arguments.add(new StringArgument(this, "watermark",
                                   "The text that can be used as watermark",
                                   String.class.getName()));
    arguments.add(new StringArgument(this, "fontsize",
                                   "The fontsize of the watermark text",
                                   String.class.getName()));
    arguments.add(new StringArgument(this, "opacity",
                                   "The opacity of the watermark text",
                                   String.class.getName()));
    destfile = new FileArgument(this, "destfile",
                                   "The file to which the watermarked PDF has to be written",
                                   true, new PdfFilter());
View Full Code Here

Examples of com.lowagie.tools.arguments.StringArgument

   */
  public SelectedPages() {
    menuoptions = MENU_EXECUTE | MENU_EXECUTE_SHOW;
    arguments.add(new FileArgument(this, "srcfile", "The file you want to split", false, new PdfFilter()));
    arguments.add(new FileArgument(this, "destfile", "The file to which the first part of the original PDF has to be written", true, new PdfFilter()));
    arguments.add(new StringArgument(this, "selection", "A selection of pages (see Help for more info)", String.class.getName()));
  }
View Full Code Here

Examples of org.jnode.shell.syntax.StringArgument

    private boolean first = true;
   
    public TailCommand() {
        super("Print the tail end of a list of files, or stdin.");
        Files        = new FileArgument("files", Argument.OPTIONAL | Argument.MULTIPLE, help_files);
        Bytes        = new StringArgument("bytes", Argument.EXISTING | Argument.OPTIONAL, help_bytes);
        Lines        = new StringArgument("lines", Argument.EXISTING | Argument.OPTIONAL, help_lines);
        Follow       = new FlagArgument("follow", Argument.OPTIONAL, help_follow);
        FollowR      = new FlagArgument("followr", Argument.OPTIONAL, help_follow_retry);
        MaxUnchanged = new IntegerArgument("unchanged", Argument.OPTIONAL, help_unchanged);
        Sleep        = new IntegerArgument("sleep", Argument.OPTIONAL, help_sleep);
        Retry        = new FlagArgument("retry", Argument.OPTIONAL, help_retry);
View Full Code Here

Examples of org.jnode.shell.syntax.StringArgument

    private PrintWriter out;
    private PrintWriter err;

    public FindCommand() {
        super(help_super);
        nameArg     = new StringArgument("name", Argument.OPTIONAL, help_name);
        inameArg    = new StringArgument("iname", Argument.OPTIONAL, help_iname);
        maxdepthArg = new LongArgument("maxdepth", Argument.OPTIONAL, help_max_depth);
        mindepthArg = new LongArgument("mindepth", Argument.OPTIONAL, help_min_depth);
        typeArg     = new StringArgument("type", Argument.OPTIONAL, help_type);
        dirArg      = new FileArgument("directory", Argument.OPTIONAL | Argument.MULTIPLE, help_dir);
        registerArguments(dirArg, mindepthArg, maxdepthArg, inameArg, nameArg, typeArg);
    }
View Full Code Here

Examples of org.jnode.shell.syntax.StringArgument

   
    public LocaleCommand() {
        super(help_super);
        argLanguage = new LanguageArgument("language", Argument.OPTIONAL, help_lang);
        argCountry  = new CountryArgument("country", Argument.OPTIONAL, help_country);
        argVariant  = new StringArgument("variant", Argument.OPTIONAL, help_variant);
        argList     = new FlagArgument("list", Argument.OPTIONAL, help_lang);
        registerArguments(argLanguage, argCountry, argVariant, argList);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.