// 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) {