private static void showAddingTaskErrorMessage(Project project, String message) { Messages.showErrorDialog(project, message, "Go Command Task"); } }
@Messages.YesNoResult private void showRestartDialog() { String action = ApplicationManagerEx.getApplicationEx().isRestartCapable() ? "Restart" : "Shutdown"; String message = action + " is required to activate SDK changes. Do you wish to continue?"; if (Messages.showYesNoDialog(message, "Apply Changes", action, "Postpone", Messages.getQuestionIcon()) == 0) { ApplicationManagerEx.getApplicationEx().restart(true); } } }
String name = Messages.showInputDialog(this, IgnoreBundle.message("settings.userTemplates.dialogDescription"), IgnoreBundle.message("settings.userTemplates.dialogTitle"), Messages.getQuestionIcon(), initialValue.getName(), new InputValidatorEx() {
@Override public void run(AnActionButton button) { String packageName = Messages.showInputDialog("Enter the import path to exclude from auto-import and completion:", "Exclude Import Path", Messages.getWarningIcon()); addExcludedPackage(packageName); }
@Test public void testDeleteWorkspaceWithProgress_UserCancel() throws Exception { final MockObserver observer = new MockObserver(manageWorkspacesModel); when(Messages.showYesNoDialog(mockProject, TfPluginBundle.message(TfPluginBundle.KEY_TFVC_MANAGE_WORKSPACES_DELETE_CONFIRM_MSG, workspace1.getName()), TfPluginBundle.message(TfPluginBundle.KEY_TFVC_MANAGE_WORKSPACES_DELETE_CONFIRM_TITLE), Messages.getWarningIcon())).thenReturn(Messages.NO); manageWorkspacesModel.deleteWorkspaceWithProgress(workspace1); observer.assertUpdateNeverOccurred(ManageWorkspacesModel.REFRESH_WORKSPACE); verifyStatic(never()); VcsUtil.runVcsProcessWithProgress(any(VcsRunnable.class), any(String.class), any(Boolean.class), any(Project.class)); Messages.showErrorDialog(any(Project.class), any(String.class), any(String.class)); }
myListModel.addElement(template); Messages.showInfoMessage(templatesListPanel, IgnoreBundle.message("action.importTemplates.success", templates.size()), IgnoreBundle.message("action.exportTemplates.success.title")); Messages.showErrorDialog(templatesListPanel, IgnoreBundle.message("action.importTemplates.error"));
assertEquals(2, model.getTableModel().getRowCount()); verifyStatic(times(1)); Messages.showWarningDialog(project, TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_NO_ROWS_SELECTED), TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_UPDATE_TITLE)); List<ServerContext> updatedContexts = new ArrayList<ServerContext>(ServerContextManager.getInstance().getAllServerContexts()); assertTrue(updatedContexts.size() == originalContexts.size()); when(Messages.showYesNoDialog(project, TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_UPDATE_MSG), TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_UPDATE_TITLE), Messages.getQuestionIcon())).thenReturn(Messages.CANCEL); model.getTableSelectionModel().setSelectionInterval(0, 0); controller.actionPerformed(new ActionEvent(this, 0, TeamServicesSettingsForm.CMD_UPDATE_PASSWORD)); when(Messages.showYesNoDialog(project, TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_UPDATE_MSG), TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_UPDATE_TITLE), Messages.getQuestionIcon())).thenReturn(Messages.OK); model.getTableSelectionModel().setSelectionInterval(0, 0); controller.actionPerformed(new ActionEvent(this, 0, TeamServicesSettingsForm.CMD_UPDATE_PASSWORD));
@Override public void invoke(@NotNull Project project, Editor editor, @NotNull PsiElement element) throws IncorrectOperationException { ApplicationManager.getApplication().invokeLater(() -> { String markerText = Messages.showInputDialog( project, PerlBundle.message("perl.intention.heredoc.dialog.prompt"), PerlBundle.message("perl.intention.heredoc.dialog.title"), Messages.getQuestionIcon(), HEREDOC_MARKER, null); if (markerText != null) { if (markerText.isEmpty()) { Messages.showErrorDialog( project, PerlBundle.message("perl.intention.heredoc.error.message"), PerlBundle.message("perl.intention.heredoc.error.title") ); } else // converting { HEREDOC_MARKER = markerText; WriteCommandAction.runWriteCommandAction(project, () -> super.invoke(project, editor, element)); } } }); }
private void addActionListenersForRemoveLocalAnalysisScriptButton() { myRemoveLocalAnalysisScriptButton.addActionListener( actionEvent -> { final Object selected = myLocalAnalysisScriptComboBox.getSelectedItem(); int rc = Messages.showOkCancelDialog( "Are you sure you want to remove "+selected.toString()+" ?", "Remove Local Analysis Script", Messages.getQuestionIcon() ); if (rc == Messages.OK) { LocalAnalysisScripts.remove(selected.toString()); myLocalAnalysisScriptComboBox.removeItem(selected); disableEditAndRemoveButtonsIfPossible(); } } ); }
@SuppressWarnings("UnresolvedPropertyKey") public boolean testGitExecutable(final Project project) { final GitVcsApplicationSettings settings = GitVcsApplicationSettings.getInstance(); final String executable = settings.getPathToGit(); final GitVersion version; try { version = GitVersion.identifyVersion(executable); } catch (Exception e) { Messages.showErrorDialog(project, e.getMessage(), GitBundle.getString("find.git.error.title")); return false; } if (!version.isSupported()) { Messages.showWarningDialog(project, GitBundle.message("find.git.unsupported.message", version.toString(), GitVersion.MIN), GitBundle.getString("find.git.success.title")); return false; } return true; }
Project project = editor.getProject(); if (suggestAlias) { alias = Messages.showInputDialog(project, "Package '" + ((PsiDirectory) element).getName() + "' already imported. Please enter an alias:", "Enter Alias", Messages.getInformationIcon()); if (alias == null || alias.isEmpty()) { Messages.showErrorDialog("Alias cannot be null or empty.", "Error"); return;
String value = Messages.showInputDialog("Group Name:", "Input Group Name:", Messages.getQuestionIcon(), currGroupName + " Copy", new InputValidator() { @Override public boolean checkInput(String inputString) { if (MessageDialogBuilder.yesNo(MsgValue.TITLE_INFO, "Confirm Delete Group " + typeMapperComboBox.getSelectedItem() + "?").isYes()) { if (Settings.DEFAULT_NAME.equals(currGroupName)) { Messages.showWarningDialog("Can't Delete Default Group!", MsgValue.TITLE_INFO); return;
private void enterCustomOrganizationKey() { while (true) { String organizationKey = Messages.showInputDialog(panel, "Please enter the organization key", "Add Another Organization", null); if (StringUtil.isNotEmpty(organizationKey)) { boolean found = selectOrganizationIfExists(organizationKey); if (found) { break; } GetOrganizationTask task = new GetOrganizationTask(model.createServerWithoutOrganization(), organizationKey); ProgressManager.getInstance().run(task); if (task.organization().isPresent()) { listModel.add(0, task.organization().get()); orgList.setSelectedIndex(0); orgList.ensureIndexIsVisible(0); break; } else if (task.getException() != null) { Messages.showErrorDialog("Failed to fetch organization from SonarQube server: " + task.getException().getMessage(), "Connection Failure"); } else { Messages.showErrorDialog(String.format("Organization '%s' not found. Please enter the key of an existing organization.", organizationKey), "Organization Not Found"); } } else { break; } } }
@Override public void actionPerformed(@NotNull AnActionEvent event) { final Project project = getEventProject(event); if(project == null) { this.setStatus(event, false); return; } PsiDirectory bundleDirContext = BundleClassGeneratorUtil.getBundleDirContext(event); if(bundleDirContext == null) { return; } final PhpClass phpClass = BundleClassGeneratorUtil.getBundleClassInDirectory(bundleDirContext); if(phpClass == null) { return; } String className = Messages.showInputDialog(project, "New class name:", "New File", Symfony2Icons.SYMFONY); if(StringUtils.isBlank(className)) { return; } if(!PhpNameUtil.isValidClassName(className)) { JOptionPane.showMessageDialog(null, "Invalid class name"); return; } write(project, phpClass, className); }
@Override public void apply() { final List<String> extensions = rows.stream().map(row -> row.getText(EXT)).collect(Collectors.toList()); final Set<String> distinct = new ArrayList<>(extensions).stream().distinct().collect(Collectors.toSet()); distinct.forEach(extensions::remove); if (!extensions.isEmpty()) { Messages.showWarningDialog(extensions.stream().reduce((f, s) -> "Duplicate : " + f + Utils.lineSeparator() + s).orElse("Error while getting extensions") + Utils.lineSeparator() + "Unexpected behavior may occur", "Duplicate Extensions"); } //TODO manage without restarting //Messages.showInfoMessage("The changes will be applied after restarting the IDE.", "LSP Settings"); serverDefinitions.clear(); for (final ServersGUIRow row : rows) { final String[] arr = row.toStringArray(); final String ext = row.getText(EXT); final UserConfigurableServerDefinition serverDefinition = UserConfigurableServerDefinition$.MODULE$.fromArray(arr); if (serverDefinition != null) { serverDefinitions.put(ext, serverDefinition); } } BallerinaLSPState.getInstance().setExtToServ(serverDefinitions); PluginMain$.MODULE$.setExtToServerDefinition(serverDefinitions); }
public static void buildFile(AnActionEvent event, final Project project, String templatePath) { String extension = (templatePath.endsWith(".yml") || templatePath.endsWith(".yaml")) ? "yml" : "xml" ; String fileName = Messages.showInputDialog(project, "File name (without extension)", String.format("Create %s Service", extension), Symfony2Icons.SYMFONY); if(fileName == null || StringUtils.isBlank(fileName)) { return; Messages.showInfoMessage("File exists", "Error"); return;
@Override public void run() { Messages.showMessageDialog(message, "Error", Messages.getInformationIcon()); } });
private int useCurrentProjectBuild() { return Messages.showYesNoDialog( "Would you like to view the current project's Gradle dependencies?", "Gradle Dependency Viewer", null); } }
@Override public void textUpdated(@NotNull DocumentEvent e, @Nullable String text) { if (getSelectedSyncType() == SyncOptions.SyncType.REV && getRevValue() < 0) { Messages.showMessageDialog( P4Bundle.message("sync.options.rev.error"), P4Bundle.message("sync.options.rev.error.title"), Messages.getErrorIcon()); } else { updateValues(parent); } }
int[] response = new int[]{-1}; ApplicationManager.getApplication().invokeAndWait(() -> { response[0] = Messages.showYesNoDialog(PerlBundle.message("perl.vm.would.you.like.to.install"), PerlBundle.message("perl.vm.empty.list.title"), getIcon()); () -> Messages.showInfoMessage(PerlBundle.message("perl.vm.empty.list.message"), PerlBundle.message("perl.vm.empty.list.title"))); return; Ref<Integer> selectionRef = Ref.create(-1); ApplicationManager.getApplication().invokeAndWait( () -> selectionRef.set(Messages.showChooseDialog( "", PerlBundle.message("perl.vm.perlbrew.choose.installation"),