public boolean removeItem(final RuntimeKey runtimeKey) { final Optional<RuntimePresenter> value = currentItems.stream() .filter(presenter -> presenter.getItem().isRuntime() && runtimeKey.equals(presenter.getItem().getRuntime().getKey())) .findFirst(); value.ifPresent(this::removeItem); return value.isPresent(); }
public boolean removeItem(final RuntimeKey runtimeKey) { final Optional<RuntimePresenter> value = currentItems.stream() .filter(presenter -> presenter.getItem().isRuntime() && runtimeKey.equals(presenter.getItem().getRuntime().getKey())) .findFirst(); value.ifPresent(this::removeItem); return value.isPresent(); }
private boolean isFromCurrentRuntime(final RuntimeKey runtimeKey) { return item != null && item.isRuntime() && item.getRuntime().getKey().equals(runtimeKey); }
private boolean isFromCurrentRuntime(final RuntimeKey runtimeKey) { return item != null && item.isRuntime() && item.getRuntime().getKey().equals(runtimeKey); }
private RemoteCallback<Void> getStartRuntimeSuccessCallback() { return aVoid -> { popupHelper.hideBusyIndicator(); notification.fire(new NotificationEvent(translationService.format(RuntimePresenter_RuntimeStartSuccessMessage, item.getRuntime().getKey().getId()), NotificationEvent.NotificationType.SUCCESS)); }; }
protected RemoteCallback<Void> getStopRuntimeSuccessCallback() { return aVoid -> { popupHelper.hideBusyIndicator(); notification.fire(new NotificationEvent(translationService.format(RuntimePresenter_RuntimeStopSuccessMessage, item.getRuntime().getKey().getId()), NotificationEvent.NotificationType.SUCCESS)); }; }
private RemoteCallback<Void> getDeleteRuntimeSuccessCallback() { return aVoid -> { popupHelper.hideBusyIndicator(); notification.fire(new NotificationEvent(translationService.format(RuntimePresenter_RuntimeDeleteSuccessMessage, item.getRuntime().getKey().getId()), NotificationEvent.NotificationType.SUCCESS)); }; }
private RemoteCallback<Void> getDeleteRuntimeSuccessCallback() { return aVoid -> { popupHelper.hideBusyIndicator(); notification.fire(new NotificationEvent(translationService.format(RuntimePresenter_RuntimeDeleteSuccessMessage, item.getRuntime().getKey().getId()), NotificationEvent.NotificationType.SUCCESS)); }; }
private RemoteCallback<Void> getStartRuntimeSuccessCallback() { return aVoid -> { popupHelper.hideBusyIndicator(); notification.fire(new NotificationEvent(translationService.format(RuntimePresenter_RuntimeStartSuccessMessage, item.getRuntime().getKey().getId()), NotificationEvent.NotificationType.SUCCESS)); }; }
protected RemoteCallback<Void> getStopRuntimeSuccessCallback() { return aVoid -> { popupHelper.hideBusyIndicator(); notification.fire(new NotificationEvent(translationService.format(RuntimePresenter_RuntimeStopSuccessMessage, item.getRuntime().getKey().getId()), NotificationEvent.NotificationType.SUCCESS)); }; }
@Test public void testOnCurrentRuntimeStopped() { prepareRuntime(); RuntimeKey currentKey = runtime.getKey(); presenter.onRuntimeChangeEvent(new RuntimeChangeEvent(RuntimeChange.STOPPED, currentKey)); verify(presenter, times(1)).refresh(currentKey); }
@Test public void testOnCurrentRuntimeStarted() { prepareRuntime(); RuntimeKey currentKey = runtime.getKey(); presenter.onRuntimeChangeEvent(new RuntimeChangeEvent(RuntimeChange.STARTED, currentKey)); verify(presenter, times(1)).refresh(currentKey); }
@Test public void testOnCurrentRuntimeStopped() { prepareRuntime(); RuntimeKey currentKey = runtime.getKey(); presenter.onRuntimeChangeEvent(new RuntimeChangeEvent(RuntimeChange.STOPPED, currentKey)); verify(presenter, times(1)).refresh(currentKey); }
protected void startRuntime() { popupHelper.showBusyIndicator(translationService.getTranslation(RuntimePresenter_RuntimeStartingMessage)); runtimeService.call(getStartRuntimeSuccessCallback(), getDefaultErrorCallback(true)).startRuntime(item.getRuntime().getKey()); }
protected void startRuntime() { popupHelper.showBusyIndicator(translationService.getTranslation(RuntimePresenter_RuntimeStartingMessage)); runtimeService.call(getStartRuntimeSuccessCallback(), getDefaultErrorCallback(true)).startRuntime(item.getRuntime().getKey()); }
protected void stopRuntime() { confirmAndExecute(translationService.getTranslation(RuntimePresenter_RuntimeConfirmStopTitle), translationService.getTranslation(RuntimePresenter_RuntimeConfirmStopMessage), () -> { popupHelper.showBusyIndicator(translationService.getTranslation(RuntimePresenter_RuntimeStoppingMessage)); runtimeService.call(getStopRuntimeSuccessCallback(), getDefaultErrorCallback(true)).stopRuntime(item.getRuntime().getKey()); }); }
protected void forceDeleteRuntime() { confirmAndExecute(translationService.getTranslation(RuntimePresenter_RuntimeConfirmForcedDeleteTitle), translationService.getTranslation(RuntimePresenter_RuntimeConfirmForcedDeleteMessage), () -> { popupHelper.showBusyIndicator(translationService.getTranslation(RuntimePresenter_RuntimeDeletingForcedMessage)); runtimeService.call(getDeleteRuntimeSuccessCallback(), getDefaultErrorCallback(true)).deleteRuntime(item.getRuntime().getKey(), true); } ); }
protected void deleteRuntime() { confirmAndExecute(translationService.getTranslation(RuntimePresenter_RuntimeConfirmDeleteTitle), translationService.getTranslation(RuntimePresenter_RuntimeConfirmDeleteMessage), () -> { popupHelper.showBusyIndicator(translationService.getTranslation(RuntimePresenter_RuntimeDeletingMessage)); runtimeService.call(getDeleteRuntimeSuccessCallback(), getDeleteRuntimeErrorCallback()).deleteRuntime(item.getRuntime().getKey(), false); } ); }
protected void forceDeleteRuntime() { confirmAndExecute(translationService.getTranslation(RuntimePresenter_RuntimeConfirmForcedDeleteTitle), translationService.getTranslation(RuntimePresenter_RuntimeConfirmForcedDeleteMessage), () -> { popupHelper.showBusyIndicator(translationService.getTranslation(RuntimePresenter_RuntimeDeletingForcedMessage)); runtimeService.call(getDeleteRuntimeSuccessCallback(), getDefaultErrorCallback(true)).deleteRuntime(item.getRuntime().getKey(), true); } ); }
protected void deleteRuntime() { confirmAndExecute(translationService.getTranslation(RuntimePresenter_RuntimeConfirmDeleteTitle), translationService.getTranslation(RuntimePresenter_RuntimeConfirmDeleteMessage), () -> { popupHelper.showBusyIndicator(translationService.getTranslation(RuntimePresenter_RuntimeDeletingMessage)); runtimeService.call(getDeleteRuntimeSuccessCallback(), getDeleteRuntimeErrorCallback()).deleteRuntime(item.getRuntime().getKey(), false); } ); }