Java Code Examples for com.intellij.openapi.options.ConfigurationException
The following examples show how to use
com.intellij.openapi.options.ConfigurationException. These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: consulo Source File: SubCompositeConfigurable.java License: Apache License 2.0 | 6 votes |
@RequiredUIAccess @Override public final void apply() throws ConfigurationException { if (root != null) { root.apply(getSettings()); XDebuggerConfigurableProvider.generalApplied(getCategory()); } if (isChildrenMerged()) { for (Configurable child : children) { if (child.isModified()) { child.apply(); } } } }
Example 2
Source Project: EclipseCodeFormatter Source File: MyConfigurable.java License: Apache License 2.0 | 6 votes |
@Override public void apply() throws ConfigurationException { if (form != null) { form.validate(); Settings profile = form.exportDisplayedSettings(); projectSettings.setProfile(profile); if (!profile.isProjectSpecific()) { GlobalSettings.getInstance().updateSettings(profile, project); } if (!project.isDefault()) { if (profile.isProjectSpecific()) { ProjectComponent.getInstance(project).installOrUpdate(profile); } else { ProjectUtils.applyToAllOpenedProjects(profile); } } } }
Example 3
Source Project: consulo-csharp Source File: CSharpCodeGenerationSettingsConfigurable.java License: Apache License 2.0 | 6 votes |
@RequiredUIAccess @Override public void apply() throws ConfigurationException { mySettings.FIELD_PREFIX = myFieldPrefixField.getText().trim(); mySettings.STATIC_FIELD_PREFIX = myStaticFieldPrefixField.getText().trim(); mySettings.PROPERTY_PREFIX = myPropertyPrefixField.getText().trim(); mySettings.STATIC_PROPERTY_PREFIX = myStaticPropertyPrefixField.getText().trim(); mySettings.FIELD_SUFFIX = myFieldSuffixField.getText().trim(); mySettings.STATIC_FIELD_SUFFIX = myStaticFieldSuffixField.getText().trim(); mySettings.PROPERTY_SUFFIX = myPropertySuffixField.getText().trim(); mySettings.STATIC_PROPERTY_SUFFIX = myStaticPropertySuffixField.getText().trim(); mySettings.USE_LANGUAGE_DATA_TYPES = myUseLanguageKeywordsCheckBox.isSelected(); myCommenterForm.apply(mySettings.getContainer()); }
Example 4
Source Project: easy_javadoc Source File: MethodConfigurable.java License: Apache License 2.0 | 6 votes |
@Override public void apply() throws ConfigurationException { TemplateConfig templateConfig = config.getMethodTemplateConfig(); templateConfig.setIsDefault(view.isDefault()); templateConfig.setTemplate(view.getTemplate()); if (templateConfig.getCustomMap() == null) { templateConfig.setCustomMap(new TreeMap<>()); } if (!view.isDefault()) { if (StringUtils.isBlank(view.getTemplate())) { throw new ConfigurationException("使用自定义模板,模板不能为空"); } String temp = StringUtils.strip(view.getTemplate()); if (!temp.startsWith("/**") || !temp.endsWith("*/")) { throw new ConfigurationException("模板格式不正确,正确的javadoc应该以\"/**\"开头,以\"*/\"结束"); } } }
Example 5
Source Project: consulo Source File: VcsBackgroundOperationsConfigurationPanel.java License: Apache License 2.0 | 6 votes |
public void apply() throws ConfigurationException { VcsConfiguration settings = VcsConfiguration.getInstance(myProject); settings.PERFORM_COMMIT_IN_BACKGROUND = myCbCommitInBackground.isSelected(); settings.PERFORM_UPDATE_IN_BACKGROUND = myCbUpdateInBackground.isSelected(); settings.PERFORM_CHECKOUT_IN_BACKGROUND = myCbCheckoutInBackground.isSelected(); settings.PERFORM_EDIT_IN_BACKGROUND = myCbEditInBackground.isSelected(); settings.PERFORM_ADD_REMOVE_IN_BACKGROUND = myCbAddRemoveInBackground.isSelected(); settings.PERFORM_ROLLBACK_IN_BACKGROUND = myPerformRevertInBackgroundCheckBox.isSelected(); boolean remoteCacheStateChanged = settings.CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND != myTrackChangedOnServer.isSelected(); if (! myProject.isDefault()) { settings.CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND = myTrackChangedOnServer.isSelected(); settings.CHANGED_ON_SERVER_INTERVAL = ((Number) myChangedOnServerInterval.getValue()).intValue(); myCacheSettingsPanel.apply(); } for (VcsShowOptionsSettingImpl setting : myPromptOptions.keySet()) { setting.setValue(myPromptOptions.get(setting).isSelected()); } // will check if should + was started -> inside RemoteRevisionsCache.getInstance(myProject).updateAutomaticRefreshAlarmState(remoteCacheStateChanged); }
Example 6
Source Project: js-graphql-intellij-plugin Source File: GraphQLProjectConfigurable.java License: MIT License | 6 votes |
public void apply() throws ConfigurationException { if (myForm != null) { if (myProject.isDefault()) { myForm.apply(); } else { WriteAction.run(() -> { myForm.apply(); }); ApplicationManager.getApplication().invokeLater(() -> { if (!myProject.isDisposed()) { DaemonCodeAnalyzer.getInstance(myProject).restart(); EditorNotifications.getInstance(myProject).updateAllNotifications(); } }, myProject.getDisposed()); } } }
Example 7
Source Project: consulo Source File: AbstractImportFromExternalSystemControl.java License: Apache License 2.0 | 6 votes |
public void apply() throws ConfigurationException { String linkedProjectPath = myLinkedProjectPathField.getText(); if (StringUtil.isEmpty(linkedProjectPath)) { throw new ConfigurationException(ExternalSystemBundle.message("error.project.undefined")); } else if (myCurrentProject != null) { ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(myExternalSystemId); assert manager != null; AbstractExternalSystemSettings<?, ?,?> settings = manager.getSettingsProvider().fun(myCurrentProject); if (settings.getLinkedProjectSettings(linkedProjectPath) != null) { throw new ConfigurationException(ExternalSystemBundle.message("error.project.already.registered")); } } //noinspection ConstantConditions myProjectSettings.setExternalProjectPath(ExternalSystemApiUtil.normalizePath(linkedProjectPath)); myProjectSettingsControl.validate(myProjectSettings); myProjectSettingsControl.apply(myProjectSettings); if (mySystemSettingsControl != null) { mySystemSettingsControl.validate(mySystemSettings); mySystemSettingsControl.apply(mySystemSettings); } }
Example 8
Source Project: intellij Source File: UseExistingBazelWorkspaceOption.java License: Apache License 2.0 | 6 votes |
@Override public WorkspaceTypeData getWorkspaceData() throws ConfigurationException { String directory = getDirectory(); if (directory.isEmpty()) { throw new ConfigurationException("Please select a workspace"); } File workspaceRootFile = new File(directory); if (!workspaceRootFile.exists()) { throw new ConfigurationException("Workspace does not exist"); } if (!isWorkspaceRoot(workspaceRootFile)) { throw new ConfigurationException( "Invalid workspace root: choose a bazel workspace directory " + "(containing a WORKSPACE file)"); } WorkspaceRoot root = new WorkspaceRoot(workspaceRootFile); return WorkspaceTypeData.builder() .setWorkspaceName(workspaceRootFile.getName()) .setWorkspaceRoot(root) .setCanonicalProjectDataLocation(workspaceRootFile) .setFileBrowserRoot(workspaceRootFile) .setWorkspacePathResolver(new WorkspacePathResolverImpl(root)) .setBuildSystem(BuildSystem.Bazel) .build(); }
Example 9
Source Project: embeddedlinux-jvmdebugger-intellij Source File: RPiJavaModuleBuilder.java License: Apache License 2.0 | 6 votes |
/** * Used to define the hierachy of the project definition * * @param rootModel * @throws ConfigurationException */ @Override public void setupRootModel(final ModifiableRootModel rootModel) throws ConfigurationException { super.setupRootModel(rootModel); final Project project = rootModel.getProject(); final VirtualFile root = createAndGetContentEntry(); rootModel.addContentEntry(root); if (myJdk != null) { rootModel.setSdk(myJdk); } else { rootModel.inheritSdk(); } createProjectFiles(rootModel, project); }
Example 10
Source Project: mule-intellij-plugins Source File: MuleRunnerEditor.java License: Apache License 2.0 | 6 votes |
/** * This is invoked when the user fills the form and pushes apply/ok * * @param runnerConfiguration runnerConfiguration * @throws ConfigurationException ex */ @Override protected void applyEditorTo(MuleConfiguration runnerConfiguration) throws ConfigurationException { runnerConfiguration.setVmArgs(this.configurationPanel.getVmArgsField().getText()); final Object selectedItem = this.configurationPanel.getMuleHome().getSelectedItem(); runnerConfiguration.setMuleHome(selectedItem instanceof MuleSdk ? ((MuleSdk) selectedItem).getMuleHome() : ""); if (this.configurationPanel.getAlwaysRadioButton().isSelected()) runnerConfiguration.setClearData(CLEAR_DATA_ALWAYS); else if (this.configurationPanel.getNeverRadioButton().isSelected()) runnerConfiguration.setClearData(CLEAR_DATA_NEVER); else runnerConfiguration.setClearData(CLEAR_DATA_PROMPT); Module[] selectedModules = this.configurationPanel.getModulesList().getSelectedModules(runnerConfiguration.getProject()); // final Module selectedModule = this.configurationPanel.getModuleCombo().getSelectedModule(); if (selectedModules != null) { runnerConfiguration.setModules(selectedModules); } }
Example 11
Source Project: EclipseCodeFormatter Source File: ProjectSettingsForm.java License: Apache License 2.0 | 6 votes |
private void showConfirmationDialogOnProfileChange() { createConfirmation("Profile was modified, save changes?", "Yes", "No", new Runnable() { @Override public void run() { try { apply(); importFrom(getSelectedItem()); } catch (ConfigurationException e) { profiles.setSelectedItem(displayedSettings); SwingUtilities.invokeLater(() -> Messages.showMessageDialog(ProjectSettingsForm.this.rootComponent, e.getMessage(), e.getTitle(), Messages.getErrorIcon())); } } }, new Runnable() { @Override public void run() { importFromInternal(getSelectedItem()); } }, 0).showInCenterOf(profiles); }
Example 12
Source Project: consulo Source File: WholeWestSingleConfigurableEditor.java License: Apache License 2.0 | 6 votes |
@Override @RequiredUIAccess protected void doAction(ActionEvent e) { try { if (myConfigurable.isModified()) { myConfigurable.apply(); myChangesWereApplied = true; setCancelButtonText(CommonBundle.getCloseButtonText()); } } catch (ConfigurationException ex) { if (myProject != null) { Messages.showMessageDialog(myProject, ex.getMessage(), ex.getTitle(), Messages.getErrorIcon()); } else { Messages.showMessageDialog(myParentComponent, ex.getMessage(), ex.getTitle(), Messages.getErrorIcon()); } } }
Example 13
Source Project: consulo Source File: PluginManagerConfigurable.java License: Apache License 2.0 | 6 votes |
@Override public void apply() throws ConfigurationException { final String applyMessage = myPluginManagerMain.apply(); if (applyMessage != null) { throw new ConfigurationException(applyMessage); } if (myPluginManagerMain.isRequireShutdown()) { final ApplicationEx app = (ApplicationEx)Application.get(); int response = app.isRestartCapable() ? showRestartIDEADialog() : showShutDownIDEADialog(); if (response == Messages.YES) { app.restart(true); } else { myPluginManagerMain.ignoreChanges(); } } }
Example 14
Source Project: EclipseCodeFormatter Source File: ProjectSettingsForm.java License: Apache License 2.0 | 6 votes |
public void validate() throws ConfigurationException { if (pathToEclipsePreferenceFileJava.isEnabled()) { if (StringUtils.isBlank(pathToEclipsePreferenceFileJava.getText())) { throw new ConfigurationException("Path to Java config file is not valid"); } if (!new File(pathToEclipsePreferenceFileJava.getText()).exists()) { throw new ConfigurationException("Path to Java config file is not valid - the file does not exist"); } } if (pathToImportOrderPreferenceFile.isEnabled()) { if (StringUtils.isBlank(pathToImportOrderPreferenceFile.getText())) { throw new ConfigurationException("Path to Import Order file is not valid"); } if (!new File(pathToImportOrderPreferenceFile.getText()).exists()) { throw new ConfigurationException("Path to Import Order file is not valid - the file does not exist"); } } if (pathToCustomEclipse.isEnabled()) { if (StringUtils.isBlank(pathToCustomEclipse.getText())) { throw new ConfigurationException("Path to custom Eclipse folder is not valid"); } if (!new File(pathToCustomEclipse.getText()).exists()) { throw new ConfigurationException("Path to custom Eclipse folder is not valid - folder does not exist"); } } }
Example 15
Source Project: consulo Source File: RenameDialog.java License: Apache License 2.0 | 5 votes |
@Override protected void canRun() throws ConfigurationException { if (Comparing.strEqual(getNewName(), myOldName)) throw new ConfigurationException(null); if (!areButtonsValid()) { throw new ConfigurationException("\'" + getNewName() + "\' is not a valid identifier"); } final Function<String, String> inputValidator = RenameInputValidatorRegistry.getInputErrorValidator(myPsiElement); if (inputValidator != null) { setErrorText(inputValidator.fun(getNewName())); } }
Example 16
Source Project: consulo Source File: BaseLibrariesConfigurable.java License: Apache License 2.0 | 5 votes |
@Override public void apply() throws ConfigurationException { super.apply(); ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { for (final LibrariesModifiableModel provider : myContext.myLevel2Providers.values()) { provider.deferredCommit(); } } }); }
Example 17
Source Project: WebStormRequireJsPlugin Source File: RequirejsSettingsPage.java License: MIT License | 5 votes |
@Override public void apply() throws ConfigurationException { project.getComponent(RequirejsProjectComponent.class).clearParse(); saveSettings(); PsiManager.getInstance(project).dropResolveCaches(); }
Example 18
Source Project: consulo Source File: NewCodeStyleSettingsPanel.java License: Apache License 2.0 | 5 votes |
public void apply() { try { if (myTab.isModified()) { myTab.apply(); } } catch (ConfigurationException e) { LOG.error(e); } }
Example 19
Source Project: consulo Source File: GeneralSettingsConfigurable.java License: Apache License 2.0 | 5 votes |
@RequiredUIAccess @Override protected void apply(@Nonnull MyComponent component) throws ConfigurationException { myGeneralSettings.setReopenLastProject(component.myChkReopenLastProject.getValue()); myGeneralSettings.setSupportScreenReaders(component.myChkSupportScreenReaders.getValue()); myGeneralSettings.setSyncOnFrameActivation(component.myChkSyncOnFrameActivation.getValue()); myGeneralSettings.setSaveOnFrameDeactivation(component.myChkSaveOnFrameDeactivation.getValue()); myGeneralSettings.setConfirmExit(component.myConfirmExit.getValue()); myGeneralSettings.setConfirmOpenNewProject(getConfirmOpenNewProject(component)); myGeneralSettings.setProcessCloseConfirmation(getProcessCloseConfirmation(component)); LocalizeManager localizeManager = LocalizeManager.getInstance(); localizeManager.setLocale(component.myLocaleBox.getValueOrError()); myGeneralSettings.setAutoSaveIfInactive(component.myChkAutoSaveIfInactive.getValue()); try { int newInactiveTimeout = Integer.parseInt(component.myTfInactiveTimeout.getValue()); if (newInactiveTimeout > 0) { myGeneralSettings.setInactiveTimeout(newInactiveTimeout); } } catch (NumberFormatException ignored) { } myGeneralSettings.setUseSafeWrite(component.myChkUseSafeWrite.getValue()); apply(component.myFileChooseDialogBox, myFileOperateDialogSettings::setFileChooseDialogId); apply(component.myFileSaveDialogBox, myFileOperateDialogSettings::setFileSaveDialogId); myWebSearchOptions.setEngine(component.myWebSearchEngineComboBox.getValue()); }
Example 20
Source Project: consulo Source File: SingleConfigurationConfigurable.java License: Apache License 2.0 | 5 votes |
@Override public void apply() throws ConfigurationException { RunnerAndConfigurationSettings settings = getSettings(); RunConfiguration runConfiguration = settings.getConfiguration(); final RunManagerImpl runManager = RunManagerImpl.getInstanceImpl(runConfiguration.getProject()); runManager.shareConfiguration(settings, myStoreProjectConfiguration); settings.setName(getNameText()); settings.setSingleton(mySingleton); settings.setFolderName(myFolderName); super.apply(); RunManagerImpl.getInstanceImpl(getConfiguration().getProject()).fireRunConfigurationChanged(settings); }
Example 21
Source Project: intellij-latte Source File: LatteCustomModifierSettingsForm.java License: MIT License | 5 votes |
@Override public void apply() throws ConfigurationException { getSettings().filterSettings = new ArrayList<>(this.tableView.getListTableModel().getItems()); getSettings().enableCustomModifiers = enableCustomModifiersCheckBox.isSelected(); this.changed = false; }
Example 22
Source Project: consulo Source File: VcsMappingConfigurationDialog.java License: Apache License 2.0 | 5 votes |
protected void doOKAction() { if (myVcsConfigurable != null) { try { myVcsConfigurable.apply(); } catch(ConfigurationException ex) { Messages.showErrorDialog(myPanel, "Invalid VCS options: " + ex.getMessage()); } } super.doOKAction(); }
Example 23
Source Project: intellij-quarkus Source File: QuarkusModuleBuilder.java License: Eclipse Public License 2.0 | 5 votes |
@NotNull @Override public Module createModule(@NotNull ModifiableModuleModel moduleModel) throws InvalidDataException, IOException, ModuleWithNameAlreadyExists, JDOMException, ConfigurationException { processDownload(); Module module = super.createModule(moduleModel); wizardContext.getUserData(QuarkusConstants.WIZARD_TOOL_KEY).processImport(module); return module; }
Example 24
Source Project: consulo Source File: CustomFoldingConfigurable.java License: Apache License 2.0 | 5 votes |
@Override public void apply() throws ConfigurationException { myConfiguration.getState().setStartFoldingPattern(mySettingsPanel.getStartPattern()); myConfiguration.getState().setEndFoldingPattern(mySettingsPanel.getEndPattern()); myConfiguration.getState().setEnabled(mySettingsPanel.isEnabled()); myConfiguration.getState().setDefaultCollapsedStatePattern(mySettingsPanel.getCollapsedStatePattern()); }
Example 25
Source Project: consulo Source File: SandServerType.java License: Apache License 2.0 | 5 votes |
@Nonnull @Override public UnnamedConfigurable createConfigurable(@Nonnull SandServerConfiguration configuration) { return new UnnamedConfigurable() { @RequiredUIAccess @Override public boolean isModified() { return false; } @RequiredUIAccess @Nullable @Override public Component createUIComponent() { return Label.create("Sand stub UI"); } @RequiredUIAccess @Override public void apply() throws ConfigurationException { } @RequiredUIAccess @Override public void reset() { } }; }
Example 26
Source Project: p4ic4idea Source File: P4VcsRootConfigurable.java License: Apache License 2.0 | 5 votes |
@Override public void apply() throws ConfigurationException { Collection<ConfigProblem> problems = null; if (isModified()) { LOG.info("Updating root configuration for " + vcsRoot); MultipleConfigPart parentPart = loadParentPartFromUI(); settings.setConfigParts(parentPart.getChildren()); 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")); } }
Example 27
Source Project: consulo Source File: ToolConfigurable.java License: Apache License 2.0 | 5 votes |
@Override public void apply() throws ConfigurationException { try { myPanel.apply(); } catch (IOException e) { throw new ConfigurationException(e.getMessage()); } }
Example 28
Source Project: consulo Source File: PathMacroConfigurable.java License: Apache License 2.0 | 5 votes |
@RequiredUIAccess @Override public void apply() throws ConfigurationException { myEditor.commit(); final Project[] projects = ProjectManager.getInstance().getOpenProjects(); for (Project project : projects) { ProjectStorageUtil.checkUnknownMacros((ProjectEx)project, false); } }
Example 29
Source Project: SmartIM4IntelliJ Source File: SmartSettingsPanel.java License: Apache License 2.0 | 5 votes |
@Override public void apply() throws ConfigurationException { generalPanel.apply(); robotPanel.apply(); uploadPanel.apply(); stylePanel.apply(); settings.loadState(settings.getState()); }
Example 30
Source Project: reasonml-idea-plugin Source File: DuneFacetEditor.java License: MIT License | 5 votes |
@Override public void apply() throws ConfigurationException { super.apply(); m_configuration.inheritProjectSdk = f_inheritProjectSDKCheck.isSelected(); Sdk odk = f_sdkSelect.getSelectedJdk(); m_configuration.sdkName = odk == null ? null : odk.getName(); // @TODO see https://github.com/reasonml-editor/reasonml-idea-plugin/issues/243 // show tool window if dune is now configured // should use a listener instead as this doesn't trigger when the facet is removed ORToolWindowManager toolWindowManager = ORToolWindowManager.getInstance(m_editorContext.getProject()); ApplicationManager.getApplication().invokeLater(toolWindowManager::showHideToolWindows); }