/** @see org.eclipse.jface.action.IAction#run() */
  public void run() {
    String filename = window.getLoadedFilename();

    if (filename == null) { // A new Wiki, not previously loaded, do SaveAs
      actionSaveAs.run();
      return;
    }

    try {
      WikiWord root = window.getRootWiki();
      (new XmlSerializer()).save(root, new FileOutputStream(filename));
      window.setModified(false);
    } catch (SerializeException E) {
      SnipPad.logError(E.getMessage(), E);
    } catch (FileNotFoundException E) {
      SnipPad.logError(E.getMessage(), E);
    }
  }
Пример #2
0
 /** @param args Arguments */
 public static void main(final String[] args) {
   SnipPad sp = new SnipPad();
   sp.setBlockOnOpen(true);
   sp.open();
   Display.getCurrent().dispose();
 }