Package com.lowagie.tools.arguments

Examples of com.lowagie.tools.arguments.StringArgument


  /**
   * Constructs an HtmlBookmarks object.
   */
  public HtmlBookmarks() {
    arguments.add(new FileArgument(this, "srcfile", "The file you want to inspect", false, new PdfFilter()));
    arguments.add(new StringArgument(this, "ownerpassword", "The owner password if the file is encrypt", String.class.getName()));
    arguments.add(new StringArgument(this, "css", "The path to a CSS file", String.class.getName()));
  }
View Full Code Here


   * Constructs an Encrypt object.
   */
  public Encrypt() {
    arguments.add(new FileArgument(this, "srcfile", "The file you want to encrypt", false, new PdfFilter()));
    arguments.add(new FileArgument(this, "destfile", "The file to which the encrypted 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()));
    arguments.add(new StringArgument(this, "userpassword", "The userpassword you want to add to the PDF file", String.class.getName()));
    arguments.add(new BitsetArgument(this, "permissions", "Permissions on the file", PERMISSION_OPTIONS));
    OptionArgument oa = new OptionArgument(this, "strength", "Strength of the encryption");
    oa.addOption("40 bit encryption", "40");
    oa.addOption("128 bit encryption", "128");
    arguments.add(oa);
View Full Code Here

    FileArgument f = new FileArgument(this, "srcfile", "The file you want to split", false, new PdfFilter());
    f.setLabel(new PdfInformationPanel());
    arguments.add(f);
    arguments.add(new FileArgument(this, "destfile1", "The file to which the first part of the original PDF has to be written", true, new PdfFilter()));
    arguments.add(new FileArgument(this, "destfile2", "The file to which the second part of the original PDF has to be written", true, new PdfFilter()));
    arguments.add(new StringArgument(this, "pagenumber", "The pagenumber where you want to split", String.class.getName()));
  }
View Full Code Here

   * Constructs a DvdCover object.
   */
  public DvdCover() {
    menuoptions = MENU_EXECUTE | MENU_EXECUTE_SHOW | MENU_EXECUTE_PRINT;
    arguments.add(new FileArgument(this, "destfile", "The file to which the PDF has to be written", true, new PdfFilter()));
    arguments.add(new StringArgument(this, "title", "The title of the DVD", String.class.getName()));
    arguments.add(new StringArgument(this, "backgroundcolor", "The backgroundcolor of the DVD Cover (for instance 0xFFFFFF)", Color.class.getName()));
    arguments.add(new ImageArgument(this, "front", "The front image of the DVD Cover"));
    arguments.add(new ImageArgument(this, "back", "The back image of the DVD Cover"));
    arguments.add(new ImageArgument(this, "side", "The side image of the DVD Cover"));
  }
View Full Code Here

  /**
   * Constructs an InpectPDF object.
   */
  public InspectPDF() {
    arguments.add(new FileArgument(this, "srcfile", "The file you want to inspect", false, new PdfFilter()));
    arguments.add(new StringArgument(this, "ownerpassword", "The owner password if the file is encrypt", String.class.getName()));
  }
View Full Code Here

   * Sets the arguments.
   * @param args the arguments as String-array.
   */
  public void setMainArguments(String[] args) {
      int counter = 0;
      StringArgument argument;
        for (Iterator i = arguments.iterator(); i.hasNext(); ) {
          argument = (StringArgument) i.next();
          if (args.length > counter) {
            argument.setValue(args[counter]);
          }
          else {
            break;
          }
          counter++;
View Full Code Here

     * @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

    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

   * @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

   * 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

TOP

Related Classes of com.lowagie.tools.arguments.StringArgument

Copyright © 2018 www.massapicom. 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.