当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurationException.getMessage方法代码示例

本文整理汇总了Java中com.intellij.openapi.options.ConfigurationException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurationException.getMessage方法的具体用法?Java ConfigurationException.getMessage怎么用?Java ConfigurationException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.options.ConfigurationException的用法示例。


在下文中一共展示了ConfigurationException.getMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateScriptName

import com.intellij.openapi.options.ConfigurationException; //导入方法依赖的package包/类
private static ValidationResult validateScriptName(String scriptName) {
  if (StringUtil.isEmpty(scriptName)) {
    return new ValidationResult("Please specify buildout script");
  }
  try {
    getScriptFile(scriptName);
  }
  catch (ConfigurationException e) {
    return new ValidationResult(e.getMessage());
  }
  return ValidationResult.OK;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:BuildoutConfigPanel.java

示例2: canApply

import com.intellij.openapi.options.ConfigurationException; //导入方法依赖的package包/类
private boolean canApply(String[] errorString, @Nullable MasterDetailsComponent rootConfigurable, boolean addedOnly) throws ConfigurationException {

    LinkedHashMap<Sdk, Sdk> sdks = new LinkedHashMap<Sdk, Sdk>(myProjectSdks);
    if (addedOnly) {
      Sdk[] allJdks = ProjectJdkTable.getInstance().getAllJdks();
      for (Sdk jdk : allJdks) {
        sdks.remove(jdk);
      }
    }
    ArrayList<String> allNames = new ArrayList<String>();
    Sdk itemWithError = null;
    for (Sdk currItem : sdks.values()) {
      String currName = currItem.getName();
      if (currName.isEmpty()) {
        itemWithError = currItem;
        errorString[0] = ProjectBundle.message("sdk.list.name.required.error");
        break;
      }
      if (allNames.contains(currName)) {
        itemWithError = currItem;
        errorString[0] = ProjectBundle.message("sdk.list.unique.name.required.error");
        break;
      }
      final SdkAdditionalData sdkAdditionalData = currItem.getSdkAdditionalData();
      if (sdkAdditionalData instanceof ValidatableSdkAdditionalData) {
        try {
          ((ValidatableSdkAdditionalData)sdkAdditionalData).checkValid(this);
        }
        catch (ConfigurationException e) {
          if (rootConfigurable != null) {
            final Object projectJdk = rootConfigurable.getSelectedObject();
            if (!(projectJdk instanceof Sdk) ||
                !Comparing.strEqual(((Sdk)projectJdk).getName(), currName)) { //do not leave current item with current name
              rootConfigurable.selectNodeInTree(currName);
            }
          }
          throw new ConfigurationException(ProjectBundle.message("sdk.configuration.exception", currName) + " " + e.getMessage());
        }
      }
      allNames.add(currName);
    }
    if (itemWithError == null) return true;
    if (rootConfigurable != null) {
      rootConfigurable.selectNodeInTree(itemWithError.getName());
    }
    return false;
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:48,代码来源:ProjectSdksModel.java


注:本文中的com.intellij.openapi.options.ConfigurationException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。