private static IEditorPart openJavaDesignEditor(IFile javaFile) throws PartInitException {
return IDE.openEditor(DesignerPlugin.getActivePage(), javaFile, IDesignerEditor.ID);
}
private static void switchToDesign(IEditorPart javaEditor) {
SwitchAction switchAction = new SwitchAction();
switchAction.setActiveEditor(null, javaEditor);
switchAction.run();
}