当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurationException类代码示例

本文整理汇总了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();
}
 
开发者ID:semihunaldi,项目名称:IdeaCurrency,代码行数:27,代码来源:IdeaCurrencyConfigUI.java

示例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);
   }
}
 
开发者ID:allandequeiroz,项目名称:random_image_background_any_jetbrains_plugin,代码行数:23,代码来源:Settings.java

示例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);
    }

}
 
开发者ID:zengkid,项目名称:SmartTomcat,代码行数:17,代码来源:TomcatSettingConfigurable.java

示例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;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:19,代码来源:PyStudyDirectoryProjectGenerator.java

示例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;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:24,代码来源:EduRemoteCourseModuleBuilder.java

示例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);
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:17,代码来源:EduModuleBuilderUtils.java

示例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;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:23,代码来源:EduTaskModuleBuilder.java

示例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());
  });
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:20,代码来源:EduIntellijCourseProjectGeneratorBase.java

示例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;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:26,代码来源:EduCustomCourseModuleBuilder.java

示例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;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:19,代码来源:EduKotlinKoansModuleBuilder.java

示例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();
    }
 
开发者ID:PioBeat,项目名称:GravSupport,代码行数:25,代码来源:GravIntroWizardStep.java


注:本文中的com.intellij.openapi.options.ConfigurationException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。