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


Java Configurable.apply方法代码示例

本文整理汇总了Java中com.intellij.openapi.options.Configurable.apply方法的典型用法代码示例。如果您正苦于以下问题:Java Configurable.apply方法的具体用法?Java Configurable.apply怎么用?Java Configurable.apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.options.Configurable的用法示例。


在下文中一共展示了Configurable.apply方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testModulesSelector

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
public void testModulesSelector() throws ConfigurationException {
  if (PlatformTestUtil.COVERAGE_ENABLED_BUILD) return;

  Module module1 = getModule1();
  Module module2 = getModule2();
  JUnitConfigurable editor = new JUnitConfigurable(myProject);
  try {
    JUnitConfiguration configuration = createConfiguration(findTestA(module2));
    editor.getComponent(); // To get all the watchers installed.
    Configurable configurable = new RunConfigurationConfigurableAdapter(editor, configuration);
    JComboBox comboBox = editor.getModulesComponent();
    configurable.reset();
    assertFalse(configurable.isModified());
    assertEquals(module2.getName(), ((Module)comboBox.getSelectedItem()).getName());
    assertEquals(ModuleManager.getInstance(myProject).getModules().length + 1, comboBox.getModel().getSize()); //no module
    comboBox.setSelectedItem(module1);
    assertTrue(configurable.isModified());
    configurable.apply();
    assertFalse(configurable.isModified());
    assertEquals(Collections.singleton(module1), ContainerUtilRt.newHashSet(configuration.getModules()));
  }
  finally {
    Disposer.dispose(editor);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ConfigurationsTest.java

示例2: testCreatingApplicationConfiguration

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
public void testCreatingApplicationConfiguration() throws ConfigurationException {
  if (PlatformTestUtil.COVERAGE_ENABLED_BUILD) return;

  ApplicationConfiguration configuration = new ApplicationConfiguration(null, myProject, ApplicationConfigurationType.getInstance());
  ApplicationConfigurable editor = new ApplicationConfigurable(myProject);
  try {
    editor.getComponent(); // To get all the watchers installed.
    Configurable configurable = new RunConfigurationConfigurableAdapter(editor, configuration);
    configurable.reset();
    CommonJavaParametersPanel javaParameters = editor.getCommonProgramParameters();
    javaParameters.setProgramParameters("prg");
    javaParameters.setVMParameters("vm");
    javaParameters.setWorkingDirectory("dir");
    assertTrue(configurable.isModified());
    configurable.apply();
    assertEquals("prg", configuration.getProgramParameters());
    assertEquals("vm", configuration.getVMParameters());
    assertEquals("dir", configuration.getWorkingDirectory());
  }
  finally {
    Disposer.dispose(editor);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ConfigurationsTest.java

示例3: apply

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
public void apply() throws ConfigurationException {
  try {
    for (Configurable configurable : myConfigurables) {
      if (configurable.isModified()) {
        configurable.apply();
      }
    }

    myCompilerConfiguration.setDefaultCompiler(mySelectedCompiler);
    myCompilerConfiguration.setProjectBytecodeTarget(myTargetLevelComponent.getProjectBytecodeTarget());
    myCompilerConfiguration.setModulesBytecodeTargetMap(myTargetLevelComponent.getModulesBytecodeTargetMap());

    myTargetLevelComponent.setProjectBytecodeTargetLevel(myCompilerConfiguration.getProjectBytecodeTarget());
    myTargetLevelComponent.setModuleTargetLevels(myCompilerConfiguration.getModulesBytecodeTargetMap());
  }
  finally {
    BuildManager.getInstance().clearState(myProject);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:JavaCompilersTab.java

示例4: apply

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
@Override
public final void apply() throws ConfigurationException {
  if (root != null) {
    root.apply(getSettings());
    for (DebuggerConfigurableProvider provider : DebuggerConfigurableProvider.EXTENSION_POINT.getExtensions()) {
      provider.generalApplied(getCategory());
    }
  }

  if (isChildrenMerged()) {
    for (Configurable child : children) {
      if (child.isModified()) {
        child.apply();
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:SubCompositeConfigurable.java

示例5: testEditJUnitConfiguration

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
public void testEditJUnitConfiguration() throws ConfigurationException {
  if (PlatformTestUtil.COVERAGE_ENABLED_BUILD) return;

  PsiClass testA = findTestA(getModule2());
  JUnitConfiguration configuration = createConfiguration(testA);
  JUnitConfigurable editor = new JUnitConfigurable(myProject);
  try {
    Configurable configurable = new RunConfigurationConfigurableAdapter(editor, configuration);
    configurable.reset();
    final EditorTextFieldWithBrowseButton component =
      ((LabeledComponent<EditorTextFieldWithBrowseButton>)editor.getTestLocation(JUnitConfigurationModel.CLASS)).getComponent();
    assertEquals(testA.getQualifiedName(), component.getText());
    PsiClass otherTest = findClass(getModule2(), "test2.Test2");
    component.setText(otherTest.getQualifiedName());
    configurable.apply();
    assertEquals(otherTest.getName(), configuration.getName());
    String specialName = "My name";
    configuration.setName(specialName);
    configuration.setNameChangedByUser(true);
    configurable.reset();
    component.setText(testA.getQualifiedName());
    configurable.apply();
    assertEquals(specialName, configuration.getName());
  }
  finally {
    Disposer.dispose(editor);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:ConfigurationsTest.java

示例6: apply

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
static ConfigurationException apply(Configurable configurable) {
  if (configurable != null) {
    try {
      configurable.apply();
      UsageTrigger.trigger("ide.settings." + ConvertUsagesUtil.escapeDescriptorName(configurable.getDisplayName()));
    }
    catch (ConfigurationException exception) {
      return exception;
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ConfigurableEditor.java

示例7: apply

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
@Override
public void apply() throws ConfigurationException {
  for (Configurable child : children) {
    if (child.isModified()) {
      child.apply();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:MergedCompositeConfigurable.java

示例8: apply

import com.intellij.openapi.options.Configurable; //导入方法依赖的package包/类
public void apply() throws ConfigurationException {
  for (Configurable configurable : configurables) {
    configurable.apply();
  }
  selectedTabIndex = tabbedPane.getSelectedIndex();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:CompositeConfigurable.java


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