use of org.eclipse.jdt.ui.IPackagesViewPart in project jbosstools-hibernate by jbosstools.
the class HibernateConsoleTestHelper method setUp.
public void setUp() throws Exception {
this.project = new SimpleTestProject();
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);
}
use of org.eclipse.jdt.ui.IPackagesViewPart in project jbosstools-hibernate by jbosstools.
the class MappingTestHelper method setUp.
public void setUp() throws Exception {
testProject = new TestProject("JUnitTestProj" + System.currentTimeMillis());
String consoleConfigName = testProject.getIProject().getName();
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());
configureTestProject();
createCfgXMLFile();
copyHbmXmlAndJavaFiles();
IPath cfgFilePath = new Path(testProject.getIProject().getName() + File.separator + TestProject.SRC_FOLDER + File.separator + ConsoleConfigUtils.CFG_FILE_NAME);
ConsoleConfigUtils.createConsoleConfig(consoleConfigName, cfgFilePath, testProject.getIProject().getName());
ProjectUtils.toggleHibernateOnProject(testProject.getIProject(), true, consoleConfigName);
testProject.fullBuild();
}
use of org.eclipse.jdt.ui.IPackagesViewPart in project jbosstools-hibernate by jbosstools.
the class AnnotationsMappingTestHelper method beforeClass.
public void beforeClass() throws Exception {
testProject = new TestProject("JUnitTestProj" + System.currentTimeMillis());
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());
IPackageFragmentRoot sourcePackageFragment = testProject.createSourceFolder();
createCfgXMLFile();
copyHbmXmlAndJavaFiles();
List<IPath> libs = testProject.copyLibs(testProject.getFolder("lib"));
testProject.generateClassPath(libs, sourcePackageFragment);
testProject.fullBuild();
}
use of org.eclipse.jdt.ui.IPackagesViewPart in project jbosstools-hibernate by jbosstools.
the class CoreMappingTestHelper method beforeClass.
public void beforeClass() throws Exception {
testProject = new TestProject("JUnitTestProj" + System.currentTimeMillis());
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());
configureTestProject();
copyHbmXmlAndJavaFiles();
}
use of org.eclipse.jdt.ui.IPackagesViewPart in project jbosstools-hibernate by jbosstools.
the class JpaMappingTestHelper method beforeClass.
public void beforeClass() throws Exception {
testProject = new TestProject("JUnitTestProj" + System.currentTimeMillis());
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());
configureTestProject();
copyHbmXmlAndJavaFiles();
}
Aggregations