public void showDocks() { if (docksHidden && !editorMaximized) { if (!docksReady) { docks.setup(LibraryPlaces.LIBRARY_PERSPECTIVE, new DefaultPlaceRequest(PROJECT_EXPLORER)); docksReady = true; } docks.show(); docksHidden = false; } }
@Test public void doNotShowDocksWithEditorMaximizedTest() { libraryPlaces.hideDocksWhenMaximizingEditor(mock(PlaceMaximizedEvent.class)); libraryPlaces.showDocks(); verify(docks, never()).setup(LibraryPlaces.LIBRARY_PERSPECTIVE, new DefaultPlaceRequest(LibraryPlaces.PROJECT_EXPLORER)); verify(docks, never()).show(); verify(docks, never()).hide(); }
@Test public void testVerifyShowAndHide() { authoringWorkbenchDocks.show(); verify(uberfireDocks).show(UberfireDockPosition.WEST, "authoring"); verify(uberfireDocks, never()).show(UberfireDockPosition.EAST, "authoring"); authoringWorkbenchDocks.hide(); // it's also disabled on setup! verify(uberfireDocks, times(2)).hide(any(), any()); }
@Test public void hideDocksTest() { libraryPlaces.showDocks(); reset(docks); libraryPlaces.hideDocks(); libraryPlaces.hideDocks(); verify(docks, times(1)).hide(); verify(docks, never()).setup(anyString(), any(PlaceRequest.class)); verify(docks, never()).show(); verify(docks, never()).expandProjectExplorer(); }
@Test public void showDocksWithEditorMinimizedTest() { libraryPlaces.hideDocksWhenMaximizingEditor(mock(PlaceMaximizedEvent.class)); libraryPlaces.showDocksWhenMinimizingEditor(mock(PlaceMinimizedEvent.class)); libraryPlaces.showDocks(); libraryPlaces.showDocks(); verify(docks, times(1)).setup(LibraryPlaces.LIBRARY_PERSPECTIVE, new DefaultPlaceRequest(LibraryPlaces.PROJECT_EXPLORER)); verify(docks, times(1)).show(); verify(docks, never()).hide(); }