@Override public void onClose(CloseEvent<PopupView> event) { if (!placeManagerIsClosingUs) { try { popupAlreadyHiding = true; placeManager.closePlace(place); } finally { popupAlreadyHiding = false; } } } });
Command createCleanupPlaceRequest(DefaultPlaceRequest placeToClose) { return () -> { placeManager.closePlace(placeToClose); }; }
Command createCleanupPlaceRequest(DefaultPlaceRequest placeToClose) { return () -> { placeManager.closePlace(placeToClose); }; }
void closeLibraryPlaces() { closingLibraryPlaces = true; LIBRARY_PLACES.forEach(place -> placeManager.closePlace(place)); closingLibraryPlaces = false; }
@Override public void execute() { if ( !placeOnClose.equals( "none" ) ) { placeManager.closePlace( place ); placeManager.forceClosePlace( placeOnClose ); } else { placeManager.closePlace( place ); } } } );
Command onConcurrentDeleteCloseCommand(final ObservablePath path) { return () -> { placeManager.closePlace(place); concurrentDeleteAcceptedEvent.fire(new ConcurrentDeleteAcceptedEvent(path)); }; }
@Override public void callback( Void v ) { processInstancesUpdatedEvent.fire(new ProcessInstancesUpdateEvent(0L)); placeManager.closePlace( place ); } }, new ErrorCallback<Message>() {
public void onRepositoryRemovedEvent(@Observes RepositoryRemovedEvent event) { if (alias.equals(event.getRepository().getAlias())) { placeManager.closePlace(place); } } }
public void onNewResourceCreated(@Observes final NewResourceSuccessEvent newResourceSuccessEvent) { if (isLibraryPerspectiveOpen()) { assetDetailEvent.fire(new AssetDetailEvent(projectContext.getActiveWorkspaceProject() .orElseThrow(() -> new IllegalStateException("Cannot fire asset detail event without an active project.")), newResourceSuccessEvent.getPath())); placeManager.closePlace(LibraryPlaces.ADD_ASSET_SCREEN); } }
@Override public void onClick(final ClickEvent event) { final WorkbenchPartPresenter.View partToDeselect = tabInvertedIndex.get(tab); panelManager.closePlace(partToDeselect.getPresenter().getDefinition().getPlace()); } });
@Test public void onCloseTest() { screen.onClose(); verify(placeManager).closePlace(PreferencesCentralNavBarScreen.IDENTIFIER); verify(placeManager).closePlace(PreferencesCentralActionsScreen.IDENTIFIER); }
@Override public void removeCurrentWidget(RenderingContext ctx) { DefaultPlaceRequest place = buildPlaceRequest(ctx.getComponent().getProperties()); if (place != null) { placeManager.closePlace(place); } }
@Override public void callback(Path path) { disposeCurrentWorkflow(); BusyPopup.close(); setOriginalHash(0); notification.fire(new NotificationEvent(DataSetAuthoringConstants.INSTANCE.savedOk())); placeManager.closePlace(placeRequest); } };
@Override public void execute() { perspectiveManager.savePerspectiveState(() -> { placeManager.closePlace(perspectiveManager.getCurrentPerspectivePlaceRequest(), () -> doRedirect(getRedirectURL())); }); // request.logout() happens as part of the redirected logout.jsp }
@Test public void testOnUserDeleted() { final DeleteUserEvent deleteUserEvent = mock(DeleteUserEvent.class); when(deleteUserEvent.getIdentifier()).thenReturn("user1"); tested.userId = "user1"; tested.onUserDeleted(deleteUserEvent); verify(placeManager, times(1)).closePlace(any(PlaceRequest.class)); } }
@Test public void testRepositoryRemovedEvent() { final RepositoryRemovedEvent event = mock(RepositoryRemovedEvent.class); final Repository repository = mock(Repository.class); when(repository.getAlias()).thenReturn("repository"); when(event.getRepository()).thenReturn(repository); presenter.onRepositoryRemovedEvent(event); verify(placeManager, times(1)).closePlace(eq(place)); }
@Test public void hideAlertsTest() { presenter.hideAlerts(); verify(placeManager).closePlace(MessageConsoleScreen.ALERTS); } }
@Test public void testOnConcurrentDeleteAcceptedCommand() { final Command onConcurrentDeleteCloseCommand = kieEditor.onConcurrentDeleteCloseCommand(observablePath); onConcurrentDeleteCloseCommand.execute(); verify(kieEditor.placeManager).closePlace(any(PlaceRequest.class)); verify(kieEditor.concurrentDeleteAcceptedEvent).fire(eq(new ConcurrentDeleteAcceptedEvent(observablePath))); }
@OnOpen public void onOpen() { final String serverTemplate = place.getParameter(StandaloneConstants.SERVER_TEMPLATE_PARAM, null); final String domainId = place.getParameter(StandaloneConstants.DOMAIN_ID_PARAM, null); final String currentProcessId = place.getParameter(StandaloneConstants.PROCESS_ID_PARAM, null); displayer.setOnCloseCommand(() -> placeManager.closePlace(place)); if (null != currentProcessId) { ProcessDefinitionKey key = new ProcessDefinitionKey(serverTemplate, domainId, currentProcessId); ProcessDisplayerConfig config = new ProcessDisplayerConfig(key, "", false); processFormDisplayProvider.setup(config, displayer); } } }
@Override protected void internalExecute(ScenarioSimulationContext context) { if (PlaceStatus.OPEN.equals(context.getPlaceManager().getStatus(context.getRightPanelRequest()))) { context.getPlaceManager().closePlace(context.getRightPanelRequest()); } else { context.getPlaceManager().goTo(context.getRightPanelRequest()); } }