/** Handle an error with IDE UI. */ private Operation<PromiseError> handleError() { return err -> { dialogFactory.createMessageDialog("IDE initialization failed", err.getMessage(), null).show(); Log.error(IdeBootstrap.class, err); }; }
private Promise<Void> getErrorPromise(String message) { return createFromAsyncRequest( callback -> dialogFactory .createMessageDialog(locale.resourceCopyMoveErrorTitle(), message, null) .show()); }
private Operation<Void> showSuccessMessage(String codeServerURL) { boolean isLocalhost = codeServerURL.equals(LOCAL_CODE_SERVER_ADDRESS); String message = isLocalhost ? messages.gwtRecompileDialogRecompilingMessage("localhost") : messages.gwtRecompileDialogRecompilingMessage("dev-machine"); MessageDialog dialog = dialogFactory.createMessageDialog(messages.gwtRecompileDialogTitle(), message, null); return aVoid -> dialog.show(); }
private Operation<PromiseError> handleStartRecompilationError(String codeServerURL) { boolean isLocalhost = codeServerURL.equals(LOCAL_CODE_SERVER_ADDRESS); return err -> { if (!isLocalhost) { setUpSuperDevModeWithUI(LOCAL_CODE_SERVER_ADDRESS); } else { dialogFactory .createMessageDialog( messages.gwtRecompileDialogTitle(), messages.gwtRecompileDialogNoServerMessage(), null) .show(); } }; } }
private void showError() { dialogFactory .createMessageDialog(locale.renameRename(), locale.renameOperationUnavailable(), null) .show(); if (mode != null) { mode.exitLinkedMode(false); } }
messages.pageGoalNewGoalAlreadyExistsMessage(existingGoal.get().getId()), () -> createGoal(newGoalName)) .show(); } else { setGoal(newGoalName);
private void handleError(@NotNull Throwable exception) { if (exception instanceof ServerException && ((ServerException) exception).getErrorCode() == ErrorCodes.NO_COMMITTER_NAME_OR_EMAIL_DEFINED) { dialogFactory .createMessageDialog(locale.commitTitle(), locale.committerIdentityInfoEmpty(), null) .show(); return; } String exceptionMessage = exception.getMessage(); String errorMessage = (exceptionMessage != null && !exceptionMessage.isEmpty()) ? exceptionMessage : locale.commitFailed(); GitOutputConsole console = gitOutputConsoleFactory.create(COMMIT_COMMAND_NAME); console.printError(errorMessage); consolesPanelPresenter.addCommandOutput(console); notificationManager.notify(locale.commitFailed(), errorMessage, FAIL, FLOAT_MODE); } }
@Override public void onCommandExecute(CommandImpl command) { view.close(); if (getMachines().isEmpty()) { // should not happen, but let's play safe dialogFactory.createMessageDialog("", messages.messageNoMachine(), null).show(); } else { machineChooser .show() .then( machine -> { commandExecutor.executeCommand(command, machine.getName()); }); } }
.createMessageDialog( locale.historyTitle(), locale.historyNothingToDisplay(), null) .show(); return;
private void fetchRevisions() { service .log( project.getLocation(), selectedPath.isEmpty() ? null : new Path[] {selectedPath}, skip, DEFAULT_PAGE_SIZE, false) .then( log -> { List<Revision> commits = log.getCommits(); if (!commits.isEmpty()) { skip += commits.size(); revisions.addAll(commits); view.setRevisions(revisions); view.showDialog(); } }) .catchError( error -> { if (getErrorCode(error.getCause()) == ErrorCodes.INIT_COMMIT_WAS_NOT_PERFORMED) { dialogFactory .createMessageDialog( locale.historyTitle(), locale.initCommitWasNotPerformed(), null) .show(); } else { notificationManager.notify(locale.logFailed(), FAIL, EMERGE_MODE); } }); }
/** Get the list of branches. */ private void getBranches() { service .branchList(project.getLocation(), BranchListMode.from(view.getFilterValue())) .then( branches -> { if (branches.isEmpty()) { dialogFactory .createMessageDialog( constant.branchTitle(), constant.initCommitWasNotPerformed(), null) .show(); } else { view.setBranches(branches); view.showDialogIfClosed(); } }) .catchError( error -> { handleError(error.getCause(), BRANCH_LIST_COMMAND_NAME); }); }
locale.compareMessageIdenticalContentText(), null) .show(); } else { AlteredFiles alteredFiles = new AlteredFiles(project, diff);
constant.initCommitWasNotPerformed(), null) .show(); return;
.createMessageDialog( constant.resetCommitViewTitle(), constant.initCommitWasNotPerformed(), null) .show(); return;
localizationConstants.debuggerAlreadyConnected(), null) .show(); return;
/** Get list of revisions. */ private void getRevisions() { service .log(project.getLocation(), new Path[] {selectedFilePath}, -1, -1, false) .then( log -> { view.setRevisions(log.getCommits()); view.showDialog(); }) .catchError( error -> { if (getErrorCode(error.getCause()) == ErrorCodes.INIT_COMMIT_WAS_NOT_PERFORMED) { dialogFactory .createMessageDialog( locale.compareWithRevisionTitle(), locale.initCommitWasNotPerformed(), null) .show(); } else { notificationManager.notify(locale.logFailed(), FAIL, NOT_EMERGE_MODE); } }); }
/** Start the current workspace with a default environment. */ Promise<Void> startWorkspace() { WorkspaceImpl workspace = appContext.getWorkspace(); String defEnvName = workspace.getConfig().getDefaultEnv(); return workspaceServiceClient .startById(workspace.getId(), defEnvName) .then( ws -> { ((AppContextImpl) appContext).setWorkspace(ws); eventBus.fireEvent(new WorkspaceStartingEvent()); }) .then((Function<WorkspaceImpl, Void>) arg -> null) .catchError( error -> { dialogFactory .createMessageDialog(messages.startWsErrorTitle(), error.getMessage(), null) .show(); wsStatusNotification.setError(STARTING_WORKSPACE_RUNTIME); startWorkspaceNotification.show(); }); }
coreMessages.messagesInvalidCommand(), () -> callback.onFailure(null)) .show(); return;