@Test public void setActiveHandler() { kogitoEditorDockSpy.setActiveHandler(handler); assertSame(kogitoEditorDockSpy.activeHandler, handler); verify(handler, times(1)).provideDocks(eq(AUTHORING_PERSPECTIVE)); assertTrue(kogitoEditorDockSpy.activeDocks.length == 2); verify(uberfireDocks, never()).remove(any()); verify(uberfireDocks, times(1)).add(isA(UberfireDock.class), isA(UberfireDock.class)); verify(uberfireDocks, times(1)).show(eq(UberfireDockPosition.EAST),eq(AUTHORING_PERSPECTIVE)); verify(uberfireDocks, never()).hide(any(), any()); }
protected void setActiveHandler(WorkbenchDocksHandler handler) { if (Objects.equals(activeHandler, handler) && !activeHandler.shouldRefreshDocks()) { return; } activeHandler = handler; if (activeHandler.shouldDisableDocks()) { uberfireDocks.hide(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } else { if (activeDocks != null) { uberfireDocks.remove(activeDocks); } Collection<UberfireDock> docks = activeHandler.provideDocks(authoringPerspectiveIdentifier); activeDocks = docks.toArray(new UberfireDock[docks.size()]); uberfireDocks.add(activeDocks); uberfireDocks.show(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } }
KogitoEditorDock implements AuthoringEditorDock { protected void setActiveHandler(WorkbenchDocksHandler handler) { if (Objects.equals(activeHandler, handler) && !activeHandler.shouldRefreshDocks()) { return; } activeHandler = handler; if (activeHandler.shouldDisableDocks()) { uberfireDocks.hide(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } else { if (activeDocks != null) { uberfireDocks.remove(activeDocks); } Collection<UberfireDock> docks = activeHandler.provideDocks(authoringPerspectiveIdentifier); activeDocks = docks.toArray(new UberfireDock[docks.size()]); uberfireDocks.add(activeDocks); uberfireDocks.show(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } } }
KogitoEditorDock implements AuthoringEditorDock { protected void setActiveHandler(WorkbenchDocksHandler handler) { if (Objects.equals(activeHandler, handler) && !activeHandler.shouldRefreshDocks()) { return; } activeHandler = handler; if (activeHandler.shouldDisableDocks()) { uberfireDocks.hide(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } else { if (activeDocks != null) { uberfireDocks.remove(activeDocks); } Collection<UberfireDock> docks = activeHandler.provideDocks(authoringPerspectiveIdentifier); activeDocks = docks.toArray(new UberfireDock[docks.size()]); uberfireDocks.add(activeDocks); uberfireDocks.show(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } } @Inject  KogitoEditorDock(final UberfireDocks uberfireDocks,
                            final ManagedInstance<WorkbenchDocksHandler> installedHandlers); }
KogitoEditorDock implements AuthoringEditorDock { protected void setActiveHandler(WorkbenchDocksHandler handler) { if (Objects.equals(activeHandler, handler) && !activeHandler.shouldRefreshDocks()) { return; } activeHandler = handler; if (activeHandler.shouldDisableDocks()) { uberfireDocks.hide(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } else { if (activeDocks != null) { uberfireDocks.remove(activeDocks); } Collection<UberfireDock> docks = activeHandler.provideDocks(authoringPerspectiveIdentifier); activeDocks = docks.toArray(new UberfireDock[docks.size()]); uberfireDocks.add(activeDocks); uberfireDocks.show(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } } @Inject  KogitoEditorDock(final UberfireDocks uberfireDocks,
                            final ManagedInstance<WorkbenchDocksHandler> installedHandlers); @PostConstruct void initialize(); @Override boolean isSetup(); @Override void setup(String authoringPerspectiveIdentifier, PlaceRequest defaultPlaceRequest); @Override void show(); @Override void hide(); @Override void expandAuthoringDock(UberfireDock dockToOpen); }
KogitoEditorDock implements AuthoringEditorDock { protected void setActiveHandler(WorkbenchDocksHandler handler) { if (Objects.equals(activeHandler, handler) && !activeHandler.shouldRefreshDocks()) { return; } activeHandler = handler; if (activeHandler.shouldDisableDocks()) { uberfireDocks.hide(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } else { if (activeDocks != null) { uberfireDocks.remove(activeDocks); } Collection<UberfireDock> docks = activeHandler.provideDocks(authoringPerspectiveIdentifier); activeDocks = docks.toArray(new UberfireDock[docks.size()]); uberfireDocks.add(activeDocks); uberfireDocks.show(UberfireDockPosition.EAST, authoringPerspectiveIdentifier); } } @Inject  KogitoEditorDock(final UberfireDocks uberfireDocks,
                            final ManagedInstance<WorkbenchDocksHandler> installedHandlers); @PostConstruct void initialize(); @Override boolean isSetup(); @Override void setup(String authoringPerspectiveIdentifier, PlaceRequest defaultPlaceRequest); @Override void show(); @Override void hide(); @Override void expandAuthoringDock(UberfireDock dockToOpen);  }