Examples of FileArgument


Examples of com.lowagie.toolbox.arguments.FileArgument

  /**
   * Constructs a 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"));
  }
View Full Code Here

Examples of com.lowagie.toolbox.arguments.FileArgument

  /**
   * Constructs a ExtractAttachements object.
   */
  public ExtractAttachments() {
    FileArgument f = new FileArgument(this, "srcfile",
        "The file you want to operate on", false, new PdfFilter());
    f.setLabel(new PdfInformationPanel());
    arguments.add(f);
  }
View Full Code Here

Examples of com.lowagie.toolbox.arguments.FileArgument

  /**
   * Constructs a Txt2Pdf object.
   */
  public Txt2Pdf() {
    menuoptions = MENU_EXECUTE | MENU_EXECUTE_SHOW | MENU_EXECUTE_PRINT_SILENT;
    arguments.add(new FileArgument(this, "srcfile", "The file you want to convert", false));
    arguments.add(new FileArgument(this, "destfile", "The file to which the converted text has to be written", true, new PdfFilter()));
    PageSizeArgument oa1 = new PageSizeArgument(this, "pagesize", "Pagesize");
    arguments.add(oa1);
    OptionArgument oa2 = new OptionArgument(this, "orientation", "Orientation of the page");
    oa2.addOption("Portrait", "PORTRAIT");
    oa2.addOption("Landscape", "LANDSCAPE");
View Full Code Here

Examples of com.lowagie.toolbox.arguments.FileArgument

  /**
   * Constructs a Burst object.
   */
  public CompressDecompressPageContent() {
    FileArgument f = new FileArgument(this, "srcfile", "The file you want to compress/decompress", false, new PdfFilter());
    f.setLabel(new PdfInformationPanel());
    arguments.add(f);
    arguments.add(new FileArgument(this, "destfile", "The file to which the compressed/decompressed PDF has to be written", true, new PdfFilter()));
    OptionArgument oa = new OptionArgument(this, "compress", "compress");
    oa.addOption("Compress page content", "true");
    oa.addOption("Decompress page content", "false");
    arguments.add(oa);
  }
View Full Code Here

Examples of com.lowagie.tools.arguments.FileArgument

  /**
   * Constructs a Burst object.
   */
  public Burst() {
    FileArgument f = new FileArgument(this, "srcfile", "The file you want to split", false, new PdfFilter());
    f.setLabel(new PdfInformationPanel());
    arguments.add(f);
  }
View Full Code Here

Examples of org.jnode.shell.syntax.FileArgument

                    break;
                case TOK_FOR_WORD:
                case TOK_FILE_NAME:
                    // Complete against the file system namespace
                    ac = new ArgumentCompleter(
                            new FileArgument("?", Argument.MANDATORY, null), token);
                    ac.complete(completions, shell);
                    break;
                case TOK_COMMAND_NAME:
                    // Complete against the command/alias/function namespaces
                    completeCommandWord(completions, shell, token);
View Full Code Here

Examples of org.jnode.shell.syntax.FileArgument

                        if (from == null && !completing) {
                            throw new ShellSyntaxException("no filename after '<'");
                        } else if (completing &&
                                (from == null || (!tokenizer.hasNext() && !wspAfter))) {
                            return new ArgumentCompleter(
                                    new FileArgument("?", Argument.MANDATORY, null), from);
                        }
                        continue;
                    } else if (token.text.equals(">")) {
                        to = parseFileName(tokenizer, ">");
                        if (to == null && !completing) {
                            throw new ShellSyntaxException("no filename after '>'");
                        } else if (completing &&
                                (to == null || (!tokenizer.hasNext() && !wspAfter))) {
                            return new ArgumentCompleter(
                                    new FileArgument("?", Argument.MANDATORY, null), to);
                        }
                        continue;
                    } else if (token.text.equals("|")) {
                        pipeTo = true;
                        break;
View Full Code Here

Examples of org.jnode.shell.syntax.FileArgument

public class ArgumentBundleTest {

    @Test
    public void testArgumentBundle() {
        new ArgumentBundle();
        new ArgumentBundle(new FileArgument("arg1", 0));
        try {
            new ArgumentBundle(new FileArgument("arg1", 0), new FileArgument("arg1", 0));
            Assert.fail("Didn't throw an IllegalArgumentException for duplicate labels");
        } catch (IllegalArgumentException ex) {
            // expected ...
        }
        try {
            new ArgumentBundle((Argument<?>) null);
            Assert.fail("Didn't throw an NullPointerException for null argument");
        } catch (NullPointerException ex) {
            // expected ...
        }
        try {
            new ArgumentBundle(new FileArgument(null, 0));
            Assert.fail("Didn't throw an NullPointerException for null label");
        } catch (NullPointerException ex) {
            // expected ...
        }
    }
View Full Code Here

Examples of org.jnode.shell.syntax.FileArgument

        }
    }

    @Test
    public void testGetArgumentString() {
        Argument<File> arg1 = new FileArgument("arg1", 0);
        Argument<File> arg2 = new FileArgument("arg2", 0);
        ArgumentBundle b = new ArgumentBundle(arg1, arg2);
        Assert.assertEquals(arg1, b.getArgument("arg1"));
        Assert.assertEquals(arg2, b.getArgument("arg2"));
        try {
            b.getArgument("arg3");
View Full Code Here

Examples of org.jnode.shell.syntax.FileArgument

        }
    }

    @Test
    public void testCreateDefaultSyntax() {
        Argument<File> arg1 = new FileArgument("arg1", 0);
        Argument<File> arg2 = new FileArgument("arg2", 0);
        MyArgumentBundle b = new MyArgumentBundle(arg1, arg2);

        b.testCreateDefaultSyntax();
    }
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.