Search in sources :

Example 6 with IPackagesViewPart

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);
}
Also used : IPackagesViewPart(org.eclipse.jdt.ui.IPackagesViewPart) FileEditorInput(org.eclipse.ui.part.FileEditorInput) PartInitException(org.eclipse.ui.PartInitException) IType(org.eclipse.jdt.core.IType)

Example 7 with IPackagesViewPart

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();
}
Also used : IPackagesViewPart(org.eclipse.jdt.ui.IPackagesViewPart) PartInitException(org.eclipse.ui.PartInitException) ConfigurableTestProject(org.hibernate.eclipse.console.test.project.ConfigurableTestProject)

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