Package org.eclipse.assemblyformatter.ir

Examples of org.eclipse.assemblyformatter.ir.Formatter


      // MessageDialog.openInformation(shell, "Editor part",
      // "Found active editor");
      ITextEditor editor = (ITextEditor) part;
      IDocumentProvider dp = editor.getDocumentProvider();
      IDocument doc = dp.getDocument(editor.getEditorInput());
      Formatter formatter = new Formatter(doc);

      try {
        formatter.replaceAnyTab(8);
      } catch (BadLocationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      }

      final String directory = "E:\\assembly-formatter\\debug\\";
      formatter.tokenize();
      try {
        formatter.writeSectionList(directory
            + "section-list tokenize().xml");
      } catch (ParserConfigurationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      } catch (IOException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      } catch (TransformerException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      }

      try {
        formatter.parse();
      } catch (BadLocationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      }

      try {
        formatter.writeSectionList(directory
            + "section-list parse().xml");
      } catch (ParserConfigurationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      } catch (IOException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      } catch (TransformerException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      }

      try {
        formatter.rewrite();
      } catch (BadLocationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      }

      try {
        formatter.writeSectionList(directory
            + "section-list format().xml");
      } catch (ParserConfigurationException e) {
        MessageDialog.openError(shell, e.getClass().getCanonicalName(),
            e.getMessage());
      } catch (IOException e) {
View Full Code Here

TOP

Related Classes of org.eclipse.assemblyformatter.ir.Formatter

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.