com.intellij.openapi.ui.Messages.showWarningDialog()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(11.0k)|赞(0)|评价(0)|浏览(91)

本文整理了Java中com.intellij.openapi.ui.Messages.showWarningDialog()方法的一些代码示例,展示了Messages.showWarningDialog()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Messages.showWarningDialog()方法的具体详情如下:
包路径:com.intellij.openapi.ui.Messages
类名称:Messages
方法名:showWarningDialog

Messages.showWarningDialog介绍

暂无

代码示例

代码示例来源:origin: ballerina-platform/ballerina-lang

@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);
}

代码示例来源:origin: jshiell/checkstyle-idea

@Override
  public void actionPerformed(final ActionEvent e) {
    final LocationDialogue dialogue = new LocationDialogue(
        project, getCheckstyleVersion(), getThirdPartyClasspath(), checkstyleProjectService);
    dialogue.setVisible(true);
    if (dialogue.isCommitted()) {
      final ConfigurationLocation newLocation = dialogue.getConfigurationLocation();
      if (locationModel.getLocations().contains(newLocation)) {
        Messages.showWarningDialog(project,
            CheckStyleBundle.message("config.file.error.duplicate.text"),
            CheckStyleBundle.message("config.file.error.duplicate.title"));
      } else {
        locationModel.addLocation(dialogue.getConfigurationLocation());
      }
    }
  }
}

代码示例来源:origin: SonarSource/sonarlint-intellij

@Override public void doRun() {
  Messages.showWarningDialog((Project) null, errorMsg, "Projects Not Updated");
 }
}, ModalityState.any());

代码示例来源:origin: makejavas/EasyCode

/**
   * 对象还原
   *
   * @param str 原始JSON字符串
   * @return 解析结果
   */
  private TableInfo parser(String str) {
    try {
      return objectMapper.readValue(str, TableInfo.class);
    } catch (IOException e) {
      Messages.showWarningDialog("读取配置失败,JSON反序列化异常。", MsgValue.TITLE_INFO);
      ExceptionUtil.rethrow(e);
    }
    return null;
  }
}

代码示例来源:origin: makejavas/EasyCode

String body = EntityUtils.toString(response.getEntity());
  if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
    Messages.showWarningDialog("连接到服务器错误!", MsgValue.TITLE_INFO);
    return null;
  Messages.showWarningDialog(msg, MsgValue.TITLE_INFO);
} catch (IOException e) {
  Messages.showWarningDialog("无法连接到服务器!", MsgValue.TITLE_INFO);
  ExceptionUtil.rethrow(e);

代码示例来源:origin: makejavas/EasyCode

Messages.showWarningDialog("JSON解析错误!", MsgValue.TITLE_INFO);
ExceptionUtil.rethrow(e);

代码示例来源:origin: makejavas/EasyCode

/**
 * post json请求
 *
 * @param uri   地址
 * @param param 参数
 * @return 请求返回结果
 */
public static String postJson(String uri, Map<String, Object> param) {
  HttpPost httpPost = new HttpPost(HOST_URL + uri);
  httpPost.setHeader(HttpHeaders.USER_AGENT, USER_AGENT);
  httpPost.setHeader(HttpHeaders.CONTENT_TYPE, CONTENT_TYPE);
  httpPost.setConfig(getDefaultConfig());
  ObjectMapper objectMapper = new ObjectMapper();
  try {
    if (!CollectionUtil.isEmpty(param)) {
      httpPost.setEntity(new StringEntity(objectMapper.writeValueAsString(param), "utf-8"));
    }
    return handlerRequest(httpPost);
  } catch (JsonProcessingException e) {
    Messages.showWarningDialog("JSON解析出错!", MsgValue.TITLE_INFO);
    ExceptionUtil.rethrow(e);
  }
  return null;
}

代码示例来源:origin: makejavas/EasyCode

Messages.showWarningDialog("Can't Select Template!", MsgValue.TITLE_INFO);
return;
Messages.showWarningDialog("Can't Select Save Path!", MsgValue.TITLE_INFO);
return;

代码示例来源:origin: makejavas/EasyCode

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;

代码示例来源:origin: SonarSource/sonarlint-intellij

if (!tooOld.isEmpty()) {
 ApplicationManager.getApplication().invokeAndWait(() ->
  Messages.showWarningDialog(buildMinimumVersionFailMessage(tooOld), "Analyzers Not Loaded"), ModalityState.any());

代码示例来源:origin: makejavas/EasyCode

Messages.showWarningDialog("保存失败,JSON序列化错误。", MsgValue.TITLE_INFO);
  return;
if (!dir.exists()) {
  if (!dir.mkdirs()) {
    Messages.showWarningDialog("保存失败,无法创建目录。", MsgValue.TITLE_INFO);
    return;

代码示例来源:origin: uwolfer/gerrit-intellij-plugin

@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;
}

代码示例来源:origin: makejavas/EasyCode

Messages.showWarningDialog("Directory Create Failure!", MsgValue.TITLE_INFO);
continue;

代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij

private static boolean isGitSupported(final Project project) {
 final GitVcsApplicationSettings settings = GitVcsApplicationSettings.getInstance();
 final String executable = settings.getPathToGit();
 final GitVersion version;
 try {
  version = GitVersion.identifyVersion(executable);
 } catch (Exception ex) {
  Messages.showErrorDialog(
    project, CloudReposMessageBundle.message("uploadtogcp.giterror"), ex.getMessage());
  return false;
 }
 if (!version.isSupported()) {
  Messages.showWarningDialog(
    project,
    CloudReposMessageBundle.message(
      "uploadtogcp.git.unsupported.message", version.toString(), GitVersion.MIN),
    CloudReposMessageBundle.message("uploadtogcp.giterror"));
  return false;
 }
 return true;
}

代码示例来源:origin: makejavas/EasyCode

for (ColumnInfo info : tableInfo.getFullColumn()) {
  if (info.getName().equals(val) && !info.getName().equals(columnInfo.getName())) {
    Messages.showWarningDialog("Column Name Already exist!", MsgValue.TITLE_INFO);

代码示例来源:origin: Microsoft/azure-devops-intellij

@Test
  public void testUpdatePasswords_NoRowSelected() {
    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.showWarningDialog(mockProject, TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_NO_ROWS_SELECTED), TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_UPDATE_TITLE));
  }
}

代码示例来源:origin: Microsoft/azure-devops-intellij

@Test
public void testDeletePasswords_NoRowSelected() {
  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.showWarningDialog(mockProject, TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_NO_ROWS_SELECTED), TfPluginBundle.message(TfPluginBundle.KEY_SETTINGS_PASSWORD_MGT_DIALOG_DELETE_TITLE));
}

代码示例来源:origin: Microsoft/azure-devops-intellij

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());

代码示例来源:origin: Microsoft/azure-devops-intellij

@Test(timeout = 60000)
public void testDeletePassword() throws Exception {
  createSettings();
  // try to delete with no selection made
  controller.actionPerformed(new ActionEvent(this, 0, TeamServicesSettingsForm.CMD_DELETE_PASSWORD));
  assertFalse(controller.isModified());
  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_DELETE_TITLE));
  // try to delete with selection but then cancel
  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.CANCEL);
  model.getTableSelectionModel().setSelectionInterval(0, 0);
  controller.actionPerformed(new ActionEvent(this, 0, TeamServicesSettingsForm.CMD_DELETE_PASSWORD));
  assertFalse(controller.isModified());
  assertEquals(2, model.getTableModel().getRowCount());
  // 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, 0);
  controller.actionPerformed(new ActionEvent(this, 0, TeamServicesSettingsForm.CMD_DELETE_PASSWORD));
  assertTrue(controller.isModified());
  assertEquals(1, model.getTableModel().getRowCount());
  assertEquals(3, ServerContextManager.getInstance().getAllServerContexts().size());
  // apply delete
  controller.actionPerformed(new ActionEvent(this, 0, TeamServicesConfigurable.CMD_APPLY_CHANGES));
  assertFalse(controller.isModified());
  assertEquals(1, model.getTableModel().getRowCount());
  assertEquals(2, ServerContextManager.getInstance().getAllServerContexts().size());
}

代码示例来源:origin: makejavas/EasyCode

Method method = ReflectionUtil.getMethod(DbPsiFacade.class, "findElement", DasObject.class);
if (method == null) {
  Messages.showWarningDialog("findElement method not found", MsgValue.TITLE_INFO);
  return;

相关文章