當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。