本文整理汇总了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;
}
示例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;
}