IEditorPart editor = HandlerUtil.getActiveEditor(event);
if (!(editor instanceof JsonPageEditor)) {
return null;
}
JsonTextEditor textEditor = (JsonTextEditor) ((JsonPageEditor) editor).getEditor();
String text = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput()).get();
JsonTextFormatter textFormatter = new JsonTextFormatter(text);
textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput()).set(textFormatter.formatText());
textEditor.getFOutlinePage().update();
return null;
}