use of com.intellij.openapi.options.ConfigurationException in project intellij-community by JetBrains.
the class PluginModuleBuildConfEditor method apply.
@Override
public void apply() throws ConfigurationException {
if (myUseUserManifest.isSelected() && !new File(myManifest.getText()).exists()) {
throw new ConfigurationException(DevKitBundle.message("error.file.not.found.message", myManifest.getText()));
}
final File plugin = new File(myBuildProperties.getPluginXmlPath());
final String newPluginPath = myPluginXML.getText() + File.separator + META_INF + File.separator + PLUGIN_XML;
if (plugin.exists() && !plugin.getPath().equals(newPluginPath)) {
Project project = myModule.getProject();
// later because we're in a write action and can't show a dialog
ApplicationManager.getApplication().invokeLater(() -> askToDeleteOldPlugin(plugin, project), project.getDisposed());
}
myBuildProperties.setPluginXmlPathAndCreateDescriptorIfDoesntExist(newPluginPath);
myBuildProperties.setManifestPath(myManifest.getText());
myBuildProperties.setUseUserManifest(myUseUserManifest.isSelected());
}
use of com.intellij.openapi.options.ConfigurationException in project intellij-community by JetBrains.
the class ScopeConfigurable method apply.
@Override
public void apply() throws ConfigurationException {
try {
myPanel.apply();
final PackageSet packageSet = myPanel.getCurrentScope();
myScope = new NamedScope(myScope.getName(), packageSet);
myPackageSet = packageSet != null ? packageSet.getText() : null;
myShareScope = mySharedCheckbox.isSelected();
} catch (ConfigurationException e) {
//was canceled - didn't change anything
}
}
use of com.intellij.openapi.options.ConfigurationException in project intellij-community by JetBrains.
the class PluginManagerConfigurable method apply.
@Override
public void apply() throws ConfigurationException {
final String applyMessage = myPluginManagerMain.apply();
if (applyMessage != null) {
throw new ConfigurationException(applyMessage);
}
boolean prev = myShutdownRequired;
myShutdownRequired |= myPluginManagerMain.isRequireShutdown();
myPluginManagerMain.ignoreChanges();
if (prev)
return;
Disposable d = UIUtil.uiParents(myPluginManagerMain.getMainPanel(), false).filter(Disposable.class).first();
if (d == null)
return;
Disposer.register(d, new Disposable() {
@Override
public void dispose() {
ApplicationManager.getApplication().invokeLater(() -> showShutdownDialogIfNeeded(), ApplicationManager.getApplication().getDisposed());
}
});
}
use of com.intellij.openapi.options.ConfigurationException in project intellij-community by JetBrains.
the class ReplaceConstructorWithBuilderDialog method canRun.
@Override
protected void canRun() throws ConfigurationException {
final PsiNameHelper nameHelper = PsiNameHelper.getInstance(myProject);
for (ParameterData parameterData : myParametersMap.values()) {
if (!nameHelper.isIdentifier(parameterData.getFieldName()))
throw new ConfigurationException("\'" + parameterData.getFieldName() + "\' is not a valid field name");
if (!nameHelper.isIdentifier(parameterData.getSetterName()))
throw new ConfigurationException("\'" + parameterData.getSetterName() + "\' is not a valid setter name");
}
if (myCreateBuilderClassRadioButton.isSelected()) {
final String className = myNewClassName.getText().trim();
if (className.length() == 0 || !nameHelper.isQualifiedName(className))
throw new ConfigurationException("\'" + className + "\' is invalid builder class name");
final String packageName = myPackageTextField.getText().trim();
if (packageName.length() > 0 && !nameHelper.isQualifiedName(packageName))
throw new ConfigurationException("\'" + packageName + "\' is invalid builder package name");
} else {
final String qualifiedName = myExistentClassTF.getText().trim();
if (qualifiedName.length() == 0 || !nameHelper.isQualifiedName(qualifiedName))
throw new ConfigurationException("\'" + qualifiedName + "\' is invalid builder qualified class name");
}
}
use of com.intellij.openapi.options.ConfigurationException in project intellij-community by JetBrains.
the class BaseRCSettingsConfigurable method isModified.
@Override
public boolean isModified() {
try {
RunnerAndConfigurationSettings original = getSettings();
RunnerAndConfigurationSettings snapshot = getEditor().getSnapshot();
final RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(original.getConfiguration().getProject());
if (runManager.findExistingConfigurationId(original) == null)
return true;
if (!super.isModified())
return false;
if (!original.isTemplate() && runManager.findExistingConfigurationId(original) == null) {
return true;
}
if (isSnapshotSpecificallyModified(runManager, original, snapshot)) {
return true;
}
if (!runManager.getBeforeRunTasks(original.getConfiguration()).equals(runManager.getBeforeRunTasks(snapshot.getConfiguration()))) {
return true;
}
if (original instanceof JDOMExternalizable && snapshot instanceof JDOMExternalizable) {
applySnapshotToComparison(original, snapshot);
Element originalElement = new Element("config");
Element snapshotElement = new Element("config");
((JDOMExternalizable) original).writeExternal(originalElement);
((JDOMExternalizable) snapshot).writeExternal(snapshotElement);
patchElementsIfNeed(originalElement, snapshotElement);
boolean result = !JDOMUtil.areElementsEqual(originalElement, snapshotElement, true);
if (!result) {
super.setModified(false);
}
return result;
}
} catch (ConfigurationException e) {
//ignore
}
return super.isModified();
}
Aggregations