/** * Checks if the ERLANG_SDK_NAME properties are configured correctly, and throws an exception * if they are not. * * @param sdkModel the model containing all configured SDKs. * @throws ConfigurationException if the ERLANG_SDK_NAME is not configured correctly. * @since 5.0.1 */ @Override public void checkValid(SdkModel sdkModel) throws ConfigurationException { if (getErlangSdk() == null) { throw new ConfigurationException("Please configure the Erlang ERLANG_SDK_NAME"); } }
@Override protected void canRun() throws ConfigurationException { if (!areButtonsValid()) { throw new ConfigurationException(RefactoringBundle.message("refactoring.introduce.name.error"), getName()); } }
private Integer validateInteger(String intText, String description) throws ConfigurationException { try { return Integer.parseInt(intText); } catch (NumberFormatException nfe) { throw new ConfigurationException( "'" + intText + "' is not a valid " + description + " number."); } }
@Override public void apply() throws ConfigurationException { Integer port = 0; try { port = Integer.parseInt(textBoxServerPort.getText()); } catch (NumberFormatException ignored) { } if(port <= 0 || port > 65535) { throw new ConfigurationException("Invalid port range"); } applicationService.serverEnabled = checkBoxServerEnabled.isSelected(); applicationService.listenAll = checkBoxServerListenAll.isSelected(); applicationService.serverPort = port; }
@Override public void apply() throws ConfigurationException { if (StringUtil.isEmpty(startTagField.getText())) { throw new ConfigurationException(TemplateToolkitBundle.message("ttk2.error.emptyopentag")); } if (StringUtil.isEmpty(endTagField.getText())) { throw new ConfigurationException(TemplateToolkitBundle.message("ttk2.error.emptyclosetag")); } if (!isModified()) { return; } mySettings.START_TAG = startTagField.getText(); mySettings.END_TAG = endTagField.getText(); mySettings.OUTLINE_TAG = outlineTagField.getText(); mySettings.ENABLE_ANYCASE = enableAnycaseCheckBox.isSelected(); mySettings.substitutedExtensions.clear(); mySettings.substitutedExtensions.addAll(substitutedExtensionsModel.getItems()); mySettings.settingsUpdated(); }
@Override public boolean validate() throws ConfigurationException { validateCommon(); if (this.fileChooser.getMarkedElements().isEmpty()) { throw new ConfigurationException( HybrisI18NBundleUtils.message("hybris.project.import.error.nothing.found.to.import"), HybrisI18NBundleUtils.message("hybris.project.import.error.unable.to.proceed") ); } return true; }
throw new ConfigurationException( HybrisI18NBundleUtils.message( "hybris.import.wizard.validation.custom.extensions.directory.does.not.exist")); throw new ConfigurationException( HybrisI18NBundleUtils.message( "hybris.import.wizard.validation.config.directory.does.not.exist")); throw new ConfigurationException( HybrisI18NBundleUtils.message( "hybris.import.wizard.validation.dbdriver.directory.does.not.exist")); throw new ConfigurationException( HybrisI18NBundleUtils.message("hybris.import.wizard.validation.hybris.distribution.directory.empty") ); throw new ConfigurationException( HybrisI18NBundleUtils.message( "hybris.import.wizard.validation.hybris.distribution.directory.does.not.exist"));
public void apply() throws ConfigurationException { if (configurationPanel != null) { try { configurationPanel.applyConfigurationData(jenkinsAppSettings, jenkinsSettings); JenkinsWindowManager.getInstance(project).reloadConfiguration(); } catch (org.codinjutsu.tools.jenkins.exception.ConfigurationException ex) { throw new ConfigurationException(ex.getMessage()); } } }
protected boolean validateCommon() throws ConfigurationException { final Set<HybrisModuleDescriptor> moduleDuplicates = this.calculateSelectedModuleDuplicates(); final Collection<String> moduleDuplicateNames = newHashSet(moduleDuplicates.size()); for (HybrisModuleDescriptor moduleDuplicate : moduleDuplicates) { moduleDuplicateNames.add(this.getModuleNameAndPath(moduleDuplicate)); } if (!moduleDuplicates.isEmpty()) { throw new ConfigurationException( HybrisI18NBundleUtils.message( "hybris.project.import.duplicate.projects.found", StringUtil.join(ArrayUtil.toStringArray(moduleDuplicateNames), "\n") ), HybrisI18NBundleUtils.message("hybris.project.error") ); } return true; }
@Override public boolean validate() throws ConfigurationException { if(StringUtil.isEmpty(this.dubBinary.getText())) { throw new ConfigurationException( DlangBundle.INSTANCE.message("d.ui.dub.config.error.path-not-set"), DlangBundle.INSTANCE.message("d.ui.dub.config.error.title") ); } else if(StringUtil.isEmpty(DLanguageToolsConfigurable.getVersion(this.dubBinary.getText()))) { throw new ConfigurationException( DlangBundle.INSTANCE.message("d.ui.dub.config.error.path-not-valid"), DlangBundle.INSTANCE.message("d.ui.dub.config.error.title") ); } return true; }
throw new ConfigurationException(errorMessage.get());
public void apply() throws ConfigurationException { CloudSdkServiceUserSettings sdkServiceUserSettings = CloudSdkServiceUserSettings.getInstance(); if (customRadioButton.isSelected()) { String customSdkPathText = getCloudSdkDirectoryText(); if (CloudSdkValidator.getInstance() .validateCloudSdk(customSdkPathText) .contains(CloudSdkValidationResult.MALFORMED_PATH)) { throw new ConfigurationException( CloudSdkMessageBundle.message("appengine.cloudsdk.location.badchars.message")); } sdkServiceUserSettings.setCustomSdkPath(customSdkPathText); } CloudSdkServiceType previousSdkType = sdkServiceUserSettings.getUserSelectedSdkServiceType(); if (previousSdkType != selectedCloudSdkServiceType) { // notify SDK manager about changed selection ServiceManager.getService(CloudSdkServiceManager.class) .onNewCloudSdkServiceTypeSelected(selectedCloudSdkServiceType); } sdkServiceUserSettings.setUserSelectedSdkServiceType(selectedCloudSdkServiceType); boolean previousAutomaticUpdateEnabled = sdkServiceUserSettings.isAutomaticUpdateEnabled(); sdkServiceUserSettings.setEnableAutomaticUpdates(enableAutomaticUpdatesCheckbox.isSelected()); if (enableAutomaticUpdatesCheckbox.isSelected() && !previousAutomaticUpdateEnabled) { // activate updates again. ManagedCloudSdkUpdateService.getInstance().activate(); } // settings are applied and saved, clear modification status settingsModified = false; }
@Override public void apply() throws ConfigurationException { Collection<ConfigProblem> problems = null; if (isModified()) { LOG.info("Updating root configuration for " + vcsRoot); // ClientConfig oldConfig = loadConfigFromSettings(); P4VcsRootSettings settings = new P4VcsRootSettingsImpl(project, vcsRoot); MultipleConfigPart parentPart = loadParentPartFromUI(); settings.setConfigParts(parentPart.getChildren()); mapping.setRootSettings(settings); if (parentPart.hasError()) { problems = parentPart.getConfigProblems(); } } else { LOG.info("Skipping root configuration update; nothing modified for " + vcsRoot); } // Send the update events regarding the root configuration updates. Do this even in the // case of an error, or if there were no updates. The no updates use case is for the situation where // events were fired in an unexpected order, then the user can rerun the apply to re-trigger everything. // It's a hack, yes. project.getMessageBus().syncPublisher(ProjectLevelVcsManager.VCS_CONFIGURATION_CHANGED) .directoryMappingChanged(); if (problems != null) { LOG.warn("Configuration problems discovered; not adding: " + problems); throw new ConfigurationException(toMessage(problems), P4Bundle.getString("configuration.error.title")); } }