本文整理匯總了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;
}