Search in sources :

Example 1 with IPackagesViewPart

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);
}
Also used : IPackagesViewPart(org.eclipse.jdt.ui.IPackagesViewPart) FileEditorInput(org.eclipse.ui.part.FileEditorInput) PartInitException(org.eclipse.ui.PartInitException) SimpleTestProject(org.jboss.tools.hibernate.orm.test.utils.project.SimpleTestProject) IType(org.eclipse.jdt.core.IType)

Example 2 with IPackagesViewPart

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();
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) IPackagesViewPart(org.eclipse.jdt.ui.IPackagesViewPart) TestProject(org.jboss.tools.hibernate.orm.test.utils.project.TestProject) IPath(org.eclipse.core.runtime.IPath) PartInitException(org.eclipse.ui.PartInitException)

Example 3 with IPackagesViewPart

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();
}
Also used : IPackagesViewPart(org.eclipse.jdt.ui.IPackagesViewPart) TestProject(org.jboss.tools.hibernate.orm.test.utils.project.TestProject) IPath(org.eclipse.core.runtime.IPath) PartInitException(org.eclipse.ui.PartInitException) IPackageFragmentRoot(org.eclipse.jdt.core.IPackageFragmentRoot)

Example 4 with IPackagesViewPart

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();
}
Also used : IPackagesViewPart(org.eclipse.jdt.ui.IPackagesViewPart) TestProject(org.jboss.tools.hibernate.orm.test.utils.project.TestProject) PartInitException(org.eclipse.ui.PartInitException)

Example 5 with IPackagesViewPart

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();
}
Also used : IPackagesViewPart(org.eclipse.jdt.ui.IPackagesViewPart) TestProject(org.jboss.tools.hibernate.orm.test.utils.project.TestProject) PartInitException(org.eclipse.ui.PartInitException)

Aggregations

IPackagesViewPart (org.eclipse.jdt.ui.IPackagesViewPart)7 PartInitException (org.eclipse.ui.PartInitException)7 TestProject (org.jboss.tools.hibernate.orm.test.utils.project.TestProject)4 IPath (org.eclipse.core.runtime.IPath)2 IType (org.eclipse.jdt.core.IType)2 FileEditorInput (org.eclipse.ui.part.FileEditorInput)2 Path (org.eclipse.core.runtime.Path)1 IPackageFragmentRoot (org.eclipse.jdt.core.IPackageFragmentRoot)1 ConfigurableTestProject (org.hibernate.eclipse.console.test.project.ConfigurableTestProject)1 SimpleTestProject (org.jboss.tools.hibernate.orm.test.utils.project.SimpleTestProject)1