use of org.eclipse.jdt.ui.IPackagesViewPart in project jbosstools-hibernate by jbosstools.
the class HibernateConsoleTest method setUp.
protected void setUp() throws Exception {
super.setUp();
this.project = createTestProject();
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(HibernateConsolePerspectiveFactory.ID_CONSOLE_PERSPECTIVE));
IPackagesViewPart packageExplorer = null;
try {
packageExplorer = (IPackagesViewPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(JavaUI.ID_PACKAGES);
} catch (PartInitException e) {
throw new RuntimeException(e);
}
IType type = this.project.getTestClassType();
packageExplorer.selectAndReveal(type);
FileEditorInput input = new FileEditorInput((IFile) type.getCompilationUnit().getCorrespondingResource());
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(input, JavaUI.ID_CU_EDITOR);
delay(2000);
}
use of org.eclipse.jdt.ui.IPackagesViewPart in project jbosstools-hibernate by jbosstools.
the class MappingTestsBase method setUp.
protected void setUp() throws Exception {
super.setUp();
// $NON-NLS-1$
testProject = new ConfigurableTestProject("JUnitTestProj" + System.currentTimeMillis());
consoleConfigName = testProject.getIProject().getName();
testPackage = null;
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(// $NON-NLS-1$
PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId("org.eclipse.ui.resourcePerspective"));
IPackagesViewPart packageExplorer = null;
try {
packageExplorer = (IPackagesViewPart) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(JavaUI.ID_PACKAGES);
} catch (PartInitException e) {
throw new RuntimeException(e);
}
packageExplorer.selectAndReveal(testProject.getIJavaProject());
// PlatformUI.getWorkbench()
// .getActiveWorkbenchWindow().getActivePage().setPerspective(
// PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(HibernateConsolePerspectiveFactory.ID_CONSOLE_PERSPECTIVE));
setUpConsoleConfig();
ProjectUtils.toggleHibernateOnProject(testProject.getIProject(), true, consoleConfigName);
testProject.fullBuild();
}
Aggregations