Search in sources :

Example 1 with IPageService

use of org.eclipse.ui.IPageService in project eclipse.platform.ui by eclipse-platform.

the class IPageServiceTest method testLocalPageService.

@Test
public void testLocalPageService() throws Throwable {
    IWorkbenchPage page = fWindow.openPage(EmptyPerspective.PERSP_ID, getPageInput());
    MockViewPart view = (MockViewPart) page.showView(MockViewPart.ID);
    IPageService slaveService = view.getSite().getService(IPageService.class);
    assertTrue(fWindow != slaveService);
    perspEventReceived = false;
    slaveService.addPerspectiveListener(this);
    page.resetPerspective();
    assertTrue(perspEventReceived);
    page.hideView(view);
    perspEventReceived = false;
    page.resetPerspective();
    assertFalse(perspEventReceived);
}
Also used : IPageService(org.eclipse.ui.IPageService) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) Test(org.junit.Test)

Aggregations

IPageService (org.eclipse.ui.IPageService)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1 Test (org.junit.Test)1