本文整理匯總了Java中com.intellij.openapi.options.ConfigurationException類的典型用法代碼示例。如果您正苦於以下問題:Java ConfigurationException類的具體用法?Java ConfigurationException怎麽用?Java ConfigurationException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ConfigurationException類屬於com.intellij.openapi.options包,在下文中一共展示了ConfigurationException類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: apply
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
@Override
public void apply() throws ConfigurationException {
Set<SelectedExchangeCurrencyPair> selectedExchangeCurrencyPairs = Sets.newHashSet();
DefaultTreeModel model = (DefaultTreeModel) tree.getModel();
DefaultMutableTreeNode root = (DefaultMutableTreeNode) model.getRoot();
Enumeration rootEnum = root.children();
while (rootEnum.hasMoreElements()) {
DefaultMutableTreeNode rootEnumObject = (DefaultMutableTreeNode) rootEnum.nextElement();
String exchangeName = rootEnumObject.getUserObject().toString();
Enumeration childEnum = rootEnumObject.children();
Set<CurrencyPair> currencyPairs = Sets.newHashSet();
while (childEnum.hasMoreElements()) {
CheckedTreeNode childEnumObject = (CheckedTreeNode) childEnum.nextElement();
if (childEnumObject.isChecked()) {
currencyPairs.add(new CurrencyPair(childEnumObject.getUserObject().toString()));
}
}
SelectedExchangeCurrencyPair selectedExchangeCurrencyPair = new SelectedExchangeCurrencyPair(exchangeName, currencyPairs);
selectedExchangeCurrencyPairs.add(selectedExchangeCurrencyPair);
}
IdeaCurrencyConfig.getInstance().setSelectedExchangeCurrencyPairs(selectedExchangeCurrencyPairs);
IdeaCurrencyConfig.getInstance().setReloadInterval(reloadIntervalSlider.getValue());
IdeaCurrencyConfig.getInstance().setActive(activeCheckBox.isSelected());
isModified = false;
triggerConfigChange();
}
示例2: apply
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
@Override
public void apply() throws ConfigurationException {
PropertiesComponent prop = PropertiesComponent.getInstance();
prop.setValue(FOLDER, imageFolder.getText());
String timeExecutionValue = timeExecution.getText();
prop.setValue(TIME_EXECUTION, timeExecutionValue);
int opcity = opacity.getValue();
prop.setValue(OPACITY, String.valueOf(opcity));
boolean isDisabled = disabled.isSelected();
prop.setValue(DISABLED, isDisabled);
ScheduledExecutorServiceHandler.shutdownExecution();
if(isDisabled) {
ActionManager.getInstance().getAction("clearBackgroundImage").actionPerformed(null);
}else {
ActionManager.getInstance().getAction("randomBackgroundImage").actionPerformed(null);
}
}
示例3: apply
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
@Override
public void apply() throws ConfigurationException {
TomcatSetting tomcatSetting = TomcatSetting.getInstance();
JList tomcatList = tomcatSetting.getTomcatList();
DefaultListModel<TomcatInfo> model = (DefaultListModel) tomcatList.getModel();
List<TomcatInfo> tomcatInfos = TomcatInfoConfigs.getInstance().getTomcatInfos();
tomcatInfos.clear();
Enumeration<TomcatInfo> elements = model.elements();
while (elements.hasMoreElements()) {
TomcatInfo tomcatInfo = elements.nextElement();
tomcatInfos.add(tomcatInfo);
}
}
示例4: actionPerformed
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
final Project project = getEventProject(anActionEvent);
if (project == null) {
return;
}
removeOldProjectData(project);
try {
collectStatistics();
final AddModuleWizard wizard = getWizard(project);
final ProjectBuilder projectBuilder = wizard.getProjectBuilder();
if (projectBuilder instanceof AbstractHybrisProjectImportBuilder) {
((AbstractHybrisProjectImportBuilder) projectBuilder).setRefresh(true);
}
projectBuilder.commit(project, null, ModulesProvider.EMPTY_MODULES_PROVIDER);
} catch (ConfigurationException e) {
Messages.showErrorDialog(
anActionEvent.getProject(),
e.getMessage(),
HybrisI18NBundleUtils.message("hybris.project.import.error.unable.to.proceed")
);
}
}
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:27,代碼來源:ProjectRefreshAction.java
示例5: getWizard
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
private AddModuleWizard getWizard(final Project project) throws ConfigurationException {
final HybrisProjectImportProvider provider = getHybrisProjectImportProvider();
final String basePath = project.getBasePath();
final String projectName = project.getName();
final Sdk jdk = ProjectRootManager.getInstance(project).getProjectSdk();
final String compilerOutputUrl = CompilerProjectExtension.getInstance(project).getCompilerOutputUrl();
final HybrisProjectSettings settings = HybrisProjectSettingsComponent.getInstance(project).getState();
final AddModuleWizard wizard = new AddModuleWizard(null, basePath, provider) {
protected void init() {
// non GUI mode
}
};
final WizardContext wizardContext = wizard.getWizardContext();
wizardContext.setProjectJdk(jdk);
wizardContext.setProjectName(projectName);
wizardContext.setCompilerOutputDirectory(compilerOutputUrl);
final StepSequence stepSequence = wizard.getSequence();
for (ModuleWizardStep step : stepSequence.getAllSteps()) {
if (step instanceof NonGuiSupport) {
((NonGuiSupport) step).nonGuiModeImport(settings);
}
}
return wizard;
}
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:27,代碼來源:ProjectRefreshAction.java
示例6: doQuickImport
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
@Override
public boolean doQuickImport(final VirtualFile file, final WizardContext wizardContext) {
this.getBuilder().cleanup();
this.getBuilder().setRootProjectDirectory(VfsUtil.virtualToIoFile(file.getParent()));
final List<HybrisModuleDescriptor> projects = this.getBuilder().getList();
if (null == projects || 1 != projects.size()) {
return false;
}
try {
this.getBuilder().setList(projects);
} catch (ConfigurationException e) {
LOG.error(e);
}
wizardContext.setProjectName(projects.get(0).getName());
return true;
}
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:21,代碼來源:HybrisProjectOpenProcessor.java
示例7: validateCommon
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
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;
}
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:21,代碼來源:AbstractSelectModulesToImportStep.java
示例8: addDetectedSdk
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
private static Sdk addDetectedSdk(@NotNull Sdk sdk, @NotNull Project project) {
final ProjectSdksModel model = PyConfigurableInterpreterList.getInstance(project).getModel();
final String name = sdk.getName();
VirtualFile sdkHome = WriteAction.compute(() -> LocalFileSystem.getInstance().refreshAndFindFileByPath(name));
sdk = SdkConfigurationUtil.createAndAddSDK(sdkHome.getPath(), PythonSdkType.getInstance());
if (sdk != null) {
PythonSdkUpdater.updateOrShowError(sdk, null, project, null);
}
model.addSdk(sdk);
try {
model.apply();
}
catch (ConfigurationException exception) {
LOG.error("Error adding detected python interpreter " + exception.getMessage());
}
return sdk;
}
示例9: createModule
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
@NotNull
@Override
public Module createModule(@NotNull ModifiableModuleModel moduleModel)
throws InvalidDataException, IOException, ModuleWithNameAlreadyExists, JDOMException, ConfigurationException {
Module baseModule = super.createModule(moduleModel);
String languageName = myCourse.getLanguageID();
Language language = Language.findLanguageByID(languageName);
if (language != null) {
EduPluginConfigurator configurator = EduPluginConfigurator.INSTANCE.forLanguage(language);
if (configurator != null) {
Project project = baseModule.getProject();
myGenerator.setSelectedCourse(myCourse);
myGenerator.generateProject(project, project.getBaseDir());
Course course = StudyTaskManager.getInstance(project).getCourse();
if (course == null) {
LOG.info("failed to generate course");
return baseModule;
}
configurator.createCourseModuleContent(moduleModel, project, course, getModuleFileDirectory());
}
}
return baseModule;
}
示例10: createCourseFromCourseInfo
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
public static void createCourseFromCourseInfo(@NotNull ModifiableModuleModel moduleModel,
@NotNull Project project,
@NotNull StudyProjectGenerator generator,
@NotNull Course course,
@Nullable String moduleDir) throws JDOMException, ModuleWithNameAlreadyExists, ConfigurationException, IOException {
generator.setSelectedCourse(course);
generator.generateProject(project, project.getBaseDir());
updateAdaptiveCourseTaskFileNames(project, course);
course = StudyTaskManager.getInstance(project).getCourse();
if (course == null) {
LOG.info("failed to generate course");
return;
}
createCourseModuleContent(moduleModel, project, course, moduleDir);
}
示例11: createModule
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
@NotNull
@Override
public Module createModule(@NotNull ModifiableModuleModel moduleModel) throws InvalidDataException, IOException, ModuleWithNameAlreadyExists, JDOMException, ConfigurationException {
Module module = super.createModule(moduleModel);
Course course = myTask.getLesson().getCourse();
String directory = getModuleFileDirectory();
if (directory == null) {
return module;
}
VirtualFile moduleDir = VfsUtil.findFileByIoFile(new File(directory), true);
if (moduleDir == null) {
return module;
}
VirtualFile src = moduleDir.findChild(EduNames.SRC);
if (src == null) {
return module;
}
createTask(module.getProject(), course, src);
ModuleRootModificationUtil.addDependency(module, myUtilModule);
EduIntellijUtils.addJUnit(module);
return module;
}
示例12: setJdk
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
protected void setJdk(@NotNull Project project) {
JdkComboBox.JdkComboBoxItem selectedItem = myJdkComboBox.getSelectedItem();
if (selectedItem instanceof JdkComboBox.SuggestedJdkItem) {
SdkType type = ((JdkComboBox.SuggestedJdkItem)selectedItem).getSdkType();
String path = ((JdkComboBox.SuggestedJdkItem)selectedItem).getPath();
myModel.addSdk(type, path, sdk -> {
myJdkComboBox.reloadModel(new JdkComboBox.ActualJdkComboBoxItem(sdk), project);
myJdkComboBox.setSelectedJdk(sdk);
});
}
try {
myModel.apply();
} catch (ConfigurationException e) {
LOG.error(e);
}
ApplicationManager.getApplication().runWriteAction(() -> {
ProjectRootManager.getInstance(project).setProjectSdk(myJdkComboBox.getSelectedJdk());
});
}
示例13: createModule
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
@NotNull
@Override
public Module createModule(@NotNull ModifiableModuleModel moduleModel)
throws InvalidDataException, IOException, ModuleWithNameAlreadyExists, JDOMException, ConfigurationException {
Module baseModule = super.createModule(moduleModel);
if (mySelectedCourse != null) {
String languageName = mySelectedCourse.getLanguageID();
Language language = Language.findLanguageByID(languageName);
if (language != null) {
EduPluginConfigurator configurator = EduPluginConfigurator.INSTANCE.forLanguage(language);
if (configurator != null) {
myGenerator.setSelectedCourse(mySelectedCourse);
Project project = baseModule.getProject();
myGenerator.generateProject(project, project.getBaseDir());
Course course = StudyTaskManager.getInstance(project).getCourse();
if (course == null) {
LOG.info("failed to generate course");
return baseModule;
}
configurator.createCourseModuleContent(moduleModel, project, course, getModuleFileDirectory());
}
}
}
return baseModule;
}
示例14: createModule
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
@NotNull
@Override
public Module createModule(@NotNull ModifiableModuleModel moduleModel) throws InvalidDataException, IOException, ModuleWithNameAlreadyExists, JDOMException, ConfigurationException {
Module baseModule = super.createModule(moduleModel);
Project project = baseModule.getProject();
EduProjectGenerator generator = new EduProjectGenerator();
if (myCourse == null) {
File courseRoot = StudyUtils.getBundledCourseRoot(DEFAULT_COURSE_NAME, EduKotlinKoansModuleBuilder.class);
final Course course = generator.addLocalCourse(FileUtil.join(courseRoot.getPath(), DEFAULT_COURSE_NAME));
if (course == null) {
LOG.info("Failed to find course " + DEFAULT_COURSE_NAME);
return baseModule;
}
}
myCourse.setLanguage("kotlin");
EduModuleBuilderUtils.createCourseFromCourseInfo(moduleModel, project, generator, myCourse, getModuleFileDirectory());
return baseModule;
}
示例15: validate
import com.intellij.openapi.options.ConfigurationException; //導入依賴的package包/類
@Override
public boolean validate() throws ConfigurationException {
if (form.getGravDirectory().isEmpty()) {
form.showHint(true);
throw new ConfigurationException("Path pointing to Grav installation is empty");
} else {
String file = form.getGravDirectory();
VirtualFile vf = LocalFileSystem.getInstance().findFileByIoFile(new File(file));
if (vf == null) {
form.showHint(true);
throw new ConfigurationException("Path to Grav installation does not exist");
} else {
if (!GravSdkType.isValidGravSDK(vf)) {
form.showHint(true);
throw new ConfigurationException("Grav installation isn't valid");
}
}
}
// if (StringUtil.isEmpty(sdkPanel.getSdkName())) {
// throw new ConfigurationException("Specify Grav SDK");
// }
form.showHint(false);
return super.validate();
}