Example #1
0
  /** Execute the command. */
  @Override
  @SuppressWarnings("nls")
  public final void execute() throws InvalidOperation {
    Document document = new Document();
    Display display = new Display();

    Form f = new Form();
    InputString inS = new InputString(f, Message.openFile());
    f.parse();

    if (entity().getDocument().loadDocument(inS.value()) != null)
      entity().setDocument(document.loadDocument(inS.value()));
    else {
      display.add(Message.fileNotFound());
      display.display();
    }
  }
Example #2
0
 /** Execute the command. */
 @Override
 @SuppressWarnings("nls")
 public final void execute() {
   Display display = new Display();
   SortedSet<Author> authors;
   authors = entity().getDocument().getAuthors();
   display.add(Message.documentTitle(entity().getDocument().getTitle()) + "\n"); // adds string
   for (Author author : authors) {
     display.add(Message.author(author.getName(), author.getEmail()) + "\n");
   }
   display.add(Message.documentSections(entity().getDocument().getSubsectionIndex()) + "\n");
   display.add(Message.documentBytes(entity().getDocument().getSize()) + "\n");
   display.add(Message.documentIdentifiers(entity().getDocument().getNumberUniqueIds()) + "\n");
   display.display();
 }