本文整理了Java中com.intellij.openapi.ui.Messages.getQuestionIcon()
方法的一些代码示例,展示了Messages.getQuestionIcon()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Messages.getQuestionIcon()
方法的具体详情如下:
包路径:com.intellij.openapi.ui.Messages
类名称:Messages
方法名:getQuestionIcon
暂无
代码示例来源:origin: ballerina-platform/ballerina-lang
@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);
}
}
}
代码示例来源:origin: ballerina-platform/ballerina-lang
@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);
}
}
}
代码示例来源:origin: hsz/idea-gitignore
IgnoreBundle.message("settings.userTemplates.dialogDescription"),
IgnoreBundle.message("settings.userTemplates.dialogTitle"),
Messages.getQuestionIcon(), initialValue.getName(), new InputValidatorEx() {
代码示例来源:origin: JetBrains/ideavim
"(You can do it manually by running 'defaults write -g " +
"ApplePressAndHoldEnabled 0' in the console).", IDEAVIM_NOTIFICATION_TITLE,
Messages.getQuestionIcon()) == Messages.YES) {
editor.setKeyRepeat(true);
keyRepeat.setEnabled(true);
代码示例来源:origin: winterDroid/android-drawable-importer-intellij-plugin
String[] options = choice == null ? new String[] {"Overwrite", "Skip"}
: new String[] {"Overwrite", "Skip", "Overwrite for all", "Skip for all"};
selection = Messages.showDialog(message, title, options, 0, Messages.getQuestionIcon());
if (selection == 2 || selection == 3) {
this.selection = selection;
代码示例来源:origin: PavlikPolivka/GitLabProjects
@Messages.YesNoResult
public static boolean showYesNoDialog(@Nullable Project project, @NotNull String title, @NotNull String message) {
return Messages.YES == Messages.showYesNoDialog(project, message, title, Messages.getQuestionIcon());
}
代码示例来源:origin: Camelcade/Perl5-IDEA
protected List<String> askFieldsNames(
Project project,
String promptText,
String promptTitle
) {
Set<String> result = new THashSet<>();
String name = Messages.showInputDialog(project, promptText, promptTitle, Messages.getQuestionIcon(), "", null);
if (!StringUtil.isEmpty(name)) {
for (String nameChunk : name.split("[ ,]+")) {
if (!nameChunk.isEmpty() && PerlParserUtil.IDENTIFIER_PATTERN.matcher(nameChunk).matches()) {
result.add(nameChunk);
}
}
}
return new ArrayList<>(result);
}
代码示例来源:origin: sonar-intellij-plugin/sonar-intellij-plugin
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();
}
}
);
}
代码示例来源:origin: sonar-intellij-plugin/sonar-intellij-plugin
private void addActionListenerForRemoveSonarServerButton() {
myRemoveSonarServerButton.addActionListener(
actionEvent -> {
final Object selectedSonarServer = mySonarServersComboBox.getSelectedItem();
int rc = Messages.showOkCancelDialog(
"Are you sure you want to remove "+selectedSonarServer.toString()+" ?",
"Remove SonarQube Server",
Messages.getQuestionIcon()
);
if (rc == Messages.OK) {
SonarServers.remove(selectedSonarServer.toString());
mySonarServersComboBox.removeItem(selectedSonarServer);
disableEditAndRemoveButtonsIfPossible();
}
}
);
}
代码示例来源:origin: halirutan/IntelliJ-Key-Promoter
private void resetStats() {
if (Messages.showYesNoDialog("Do you really want to reset your Key Promoter statistics? This cannot be undone!", "Reset Statistics", Messages.getQuestionIcon()) == 0) {
Map<String, Integer> stats = statsService.getStats();
stats.clear();
statsService.setStats(stats);
updateTopTen();
}
}
代码示例来源:origin: BashSupport/BashSupport
@NotNull
protected final PsiElement[] invokeDialog(final Project project, final PsiDirectory directory) {
final MyInputValidator validator = new MyInputValidator(project, directory);
Messages.showInputDialog(project, getDialogPrompt(), getDialogTitle(), Messages.getQuestionIcon(), "", validator);
return validator.getCreatedElements();
}
代码示例来源:origin: halirutan/IntelliJ-Key-Promoter-X
private void resetStats() {
if (Messages.showYesNoDialog(
KeyPromoterBundle.message("kp.dialog.reset.statistic.text"),
KeyPromoterBundle.message("kp.dialog.reset.statistic.title"),
Messages.getQuestionIcon()) == 0) {
statService.resetStatistic();
}
}
代码示例来源:origin: Camelcade/Perl5-IDEA
@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));
}
}
});
}
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
@Override
public void actionPerformed(AnActionEvent event) {
int result =
Messages.showOkCancelDialog(
StackdriverDebuggerBundle.getString("clouddebug.remove.all"),
StackdriverDebuggerBundle.getString("clouddebug.delete.snapshots"),
StackdriverDebuggerBundle.getString("clouddebug.buttondelete"),
StackdriverDebuggerBundle.getString("clouddebug.cancelbutton"),
Messages.getQuestionIcon());
if (result == Messages.OK) { // pressed remove all
SnapshotsModel model = getModel();
fireDeleteBreakpoints(model.getBreakpoints());
}
}
}
代码示例来源:origin: Camelcade/Perl5-IDEA
protected void createAutobaseNamesComponent(FormBuilder builder) {
autobaseModel = new CollectionListModel<>();
autobaseList = new JBList<>(autobaseModel);
builder.addLabeledComponent(
new JLabel("Autobase names (autobase_names option. Order is important, later components may be inherited from early):"),
ToolbarDecorator
.createDecorator(autobaseList)
.setAddAction(anActionButton -> {
String fileName = Messages.showInputDialog(
myProject,
"Type new Autobase filename:",
"New Autobase Filename",
Messages.getQuestionIcon(),
"",
null);
if (StringUtil.isNotEmpty(fileName) && !autobaseModel.getItems().contains(fileName)) {
autobaseModel.add(fileName);
}
})
.setPreferredSize(JBUI.size(0, PerlConfigurationUtil.WIDGET_HEIGHT))
.createPanel());
}
}
代码示例来源:origin: Microsoft/azure-devops-intellij
@Test
public void testUpdatePasswords_OK() {
teamServicesSettingsModel.getTableSelectionModel().setSelectionInterval(0, 0);
when(Messages.showYesNoDialog(mockProject, TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_UPDATE_MSG), TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_UPDATE_TITLE), Messages.getQuestionIcon())).thenReturn(Messages.YES);
teamServicesSettingsModel.getTableModel().addServerContexts(new ArrayList<ServerContext>(ImmutableList.of(mockServerContext_GitRepo, mockServerContext_TfvcRepo)));
teamServicesSettingsModel.updatePasswords();
assertEquals(0, teamServicesSettingsModel.getDeleteContexts().size());
assertEquals(2, teamServicesSettingsModel.getTableModel().getRowCount());
verifyStatic(times(1));
Messages.showYesNoDialog(eq(mockProject), eq(TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_UPDATE_MSG)), eq(TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_UPDATE_TITLE)), any(Icon.class));
}
代码示例来源:origin: Microsoft/azure-devops-intellij
@Test
public void testDeletePasswords_OK() {
teamServicesSettingsModel.getTableSelectionModel().setSelectionInterval(0, 0);
when(Messages.showYesNoDialog(mockProject, TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_DELETE_MSG), TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_DELETE_TITLE), Messages.getQuestionIcon())).thenReturn(Messages.YES);
teamServicesSettingsModel.getTableModel().addServerContexts(new ArrayList<ServerContext>(ImmutableList.of(mockServerContext_GitRepo, mockServerContext_TfvcRepo)));
teamServicesSettingsModel.deletePasswords();
assertEquals(1, teamServicesSettingsModel.getDeleteContexts().size());
assertEquals(1, teamServicesSettingsModel.getTableModel().getRowCount());
assertEquals(mockServerContext_GitRepo, teamServicesSettingsModel.getTableModel().getServerContext(0));
verifyStatic(times(1));
Messages.showYesNoDialog(eq(mockProject), eq(TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_DELETE_MSG)), eq(TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_DELETE_TITLE)), any(Icon.class));
}
代码示例来源:origin: Microsoft/azure-devops-intellij
@Test
public void testDeletePasswords_Cancel() {
teamServicesSettingsModel.getTableSelectionModel().setSelectionInterval(0, 0);
when(Messages.showYesNoDialog(mockProject, TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_DELETE_MSG), TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_DELETE_TITLE), Messages.getQuestionIcon())).thenReturn(Messages.CANCEL);
teamServicesSettingsModel.getTableModel().addServerContexts(new ArrayList<ServerContext>(ImmutableList.of(mockServerContext_GitRepo, mockServerContext_TfvcRepo)));
teamServicesSettingsModel.deletePasswords();
assertEquals(0, teamServicesSettingsModel.getDeleteContexts().size());
assertEquals(2, teamServicesSettingsModel.getTableModel().getRowCount());
assertEquals(mockServerContext_TfvcRepo, teamServicesSettingsModel.getTableModel().getServerContext(0));
assertEquals(mockServerContext_GitRepo, teamServicesSettingsModel.getTableModel().getServerContext(1));
verifyStatic(times(1));
Messages.showYesNoDialog(eq(mockProject), eq(TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_DELETE_MSG)), eq(TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_DELETE_TITLE)), any(Icon.class));
}
代码示例来源:origin: Microsoft/azure-devops-intellij
@Test
public void testUpdatePasswords_Cancel() {
teamServicesSettingsModel.getTableSelectionModel().setSelectionInterval(0, 0);
when(Messages.showYesNoDialog(mockProject, 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);
teamServicesSettingsModel.getTableModel().addServerContexts(new ArrayList<ServerContext>(ImmutableList.of(mockServerContext_GitRepo, mockServerContext_TfvcRepo)));
teamServicesSettingsModel.updatePasswords();
assertEquals(0, teamServicesSettingsModel.getDeleteContexts().size());
assertEquals(2, teamServicesSettingsModel.getTableModel().getRowCount());
assertEquals(mockServerContext_TfvcRepo, teamServicesSettingsModel.getTableModel().getServerContext(0));
assertEquals(mockServerContext_GitRepo, teamServicesSettingsModel.getTableModel().getServerContext(1));
verifyStatic(times(1));
Messages.showYesNoDialog(eq(mockProject), eq(TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_UPDATE_MSG)), eq(TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_UPDATE_TITLE)), any(Icon.class));
}
代码示例来源:origin: Microsoft/azure-devops-intellij
@Test
public void testReset() {
createSettings();
// do delete
when(Messages.showYesNoDialog(project, TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_DELETE_MSG), TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_DELETE_TITLE), Messages.getQuestionIcon())).thenReturn(Messages.OK);
model.getTableSelectionModel().setSelectionInterval(0, 1);
controller.actionPerformed(new ActionEvent(this, 0, TeamServicesSettingsForm.CMD_DELETE_PASSWORD));
assertTrue(controller.isModified());
assertEquals(0, model.getTableModel().getRowCount());
assertEquals(3, ServerContextManager.getInstance().getAllServerContexts().size());
// reset
controller.actionPerformed(new ActionEvent(this, 0, TeamServicesConfigurable.CMD_RESET_CHANGES));
assertFalse(controller.isModified());
assertEquals(2, model.getTableModel().getRowCount());
assertEquals(3, ServerContextManager.getInstance().getAllServerContexts().size());
}
内容来源于网络,如有侵权,请联系作者删除!