當前位置: 首頁>>代碼示例>>Java>>正文


Java Configurable.reset方法代碼示例

本文整理匯總了Java中com.intellij.openapi.options.Configurable.reset方法的典型用法代碼示例。如果您正苦於以下問題:Java Configurable.reset方法的具體用法?Java Configurable.reset怎麽用?Java Configurable.reset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.options.Configurable的用法示例。


在下文中一共展示了Configurable.reset方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: getOptions

import com.intellij.openapi.options.Configurable; //導入方法依賴的package包/類
@NotNull
@Override
public Collection<BooleanOptionDescription> getOptions(@Nullable Project project) {
  try {
    Configurable configurable = getConfigurable(project);
    Component component = configurable.createComponent();
    configurable.reset();
    myPrefix.clear();
    String name = getName(configurable);
    if (name != null) {
      myPrefix.push(name);
    }
    Collection<BooleanOptionDescription> options = new ArrayList<BooleanOptionDescription>();
    init(options, configurable, component);
    return Collections.unmodifiableCollection(options);
  }
  catch (Exception exception) {
    LOG.debug(exception);
  }
  return Collections.emptyList();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:ConfigurableOptionsTopHitProvider.java

示例4: testNotModifiedAfterCreation

import com.intellij.openapi.options.Configurable; //導入方法依賴的package包/類
public void testNotModifiedAfterCreation() throws Exception {
  MavenSettings s = new MavenSettings(myProject);
  s.createComponent();
  s.reset();
  try {
    assertFalse(s.isModified());
  }
  finally {
    s.disposeUIResources(); //prevent memory leaks
  }

  for (Configurable each : s.getConfigurables()) {
    each.createComponent();
    each.reset();
    try {
      assertFalse(each.isModified());
    }
    finally {
      each.disposeUIResources(); //prevent memory leaks
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:23,代碼來源:MavenSettingsTest.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: reset

import com.intellij.openapi.options.Configurable; //導入方法依賴的package包/類
public void reset() {
  for (Configurable configurable : myConfigurables) {
    configurable.reset();
  }
  selectCompiler(myCompilerConfiguration.getDefaultCompiler());
  myTargetLevelComponent.setProjectBytecodeTargetLevel(myCompilerConfiguration.getProjectBytecodeTarget());
  myTargetLevelComponent.setModuleTargetLevels(myCompilerConfiguration.getModulesBytecodeTargetMap());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:JavaCompilersTab.java

示例7: reset

import com.intellij.openapi.options.Configurable; //導入方法依賴的package包/類
public static void reset(Configurable configurable) {
  if (configurable != null) {
    long time = System.currentTimeMillis();
    try {
      configurable.reset();
    }
    catch (Exception unexpected) {
      LOG.error("cannot reset configurable", unexpected);
    }
    finally {
      warn(configurable, "reset", time);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:15,代碼來源:ConfigurableCardPanel.java

示例8: reset

import com.intellij.openapi.options.Configurable; //導入方法依賴的package包/類
@Override
public final void reset() {
  if (root != null) {
    root.reset(getSettings());
  }

  if (isChildrenMerged()) {
    for (Configurable child : children) {
      child.reset();
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:SubCompositeConfigurable.java

示例9: reset

import com.intellij.openapi.options.Configurable; //導入方法依賴的package包/類
@Override
public void reset() {
  myTemplateExpandShortcutPanel.setSelectedChar((char)EmmetOptions.getInstance().getEmmetExpandShortcut());
  for (Configurable configurable : myInnerConfigurables) {
    configurable.reset();
  }
  super.reset();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:EmmetCompositeConfigurable.java

示例10: apply

import com.intellij.openapi.options.Configurable; //導入方法依賴的package包/類
@Override
public void apply() throws ConfigurationException {
  EmmetOptions.getInstance().setEmmetExpandShortcut(myTemplateExpandShortcutPanel.getSelectedChar());
  for (Configurable configurable : myInnerConfigurables) {
    configurable.reset();
  }
  super.apply();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:EmmetCompositeConfigurable.java

示例11: reset

import com.intellij.openapi.options.Configurable; //導入方法依賴的package包/類
@Override
public void reset() {
  // need this to ensure VFS operations will not block because of storage flushing
  // and other maintenance IO tasks run in background
  AccessToken token = HeavyProcessLatch.INSTANCE.processStarted("Resetting Project Structure");

  try {
    myWasUiDisposed = false;

    myContext.reset();

    myProjectJdksModel.reset(myProject);

    Configurable toSelect = null;
    for (Configurable each : myName2Config) {
      if (myUiState.lastEditedConfigurable != null && myUiState.lastEditedConfigurable.equals(each.getDisplayName())) {
        toSelect = each;
      }
      if (each instanceof MasterDetailsComponent) {
        ((MasterDetailsComponent)each).setHistory(myHistory);
      }
      each.reset();
    }

    myHistory.clear();

    if (toSelect == null && myName2Config.size() > 0) {
      toSelect = myName2Config.iterator().next();
    }

    removeSelected();

    navigateTo(toSelect != null ? createPlaceFor(toSelect) : null, false);

    if (myUiState.proportion > 0) {
      mySplitter.setProportion(myUiState.proportion);
    }
  }
  finally {
    token.finish();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:43,代碼來源:ProjectStructureConfigurable.java

示例12: reset

import com.intellij.openapi.options.Configurable; //導入方法依賴的package包/類
@Override
public void reset() {
  for (Configurable child : children) {
    child.reset();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:MergedCompositeConfigurable.java

示例13: addComponent

import com.intellij.openapi.options.Configurable; //導入方法依賴的package包/類
private void addComponent(AbstractVcs vcs, Configurable configurable, String constraint) {
  myEnvToConfMap.put(vcs, configurable);
  myMainPanel.add(configurable.createComponent(), constraint);
  configurable.reset();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:6,代碼來源:UpdateOrStatusOptionsDialog.java

示例14: reset

import com.intellij.openapi.options.Configurable; //導入方法依賴的package包/類
public void reset() {
  for (Configurable configurable : configurables) {
    configurable.reset();
  }
  tabbedPane.setSelectedIndex(selectedTabIndex);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:CompositeConfigurable.java


注:本文中的com.intellij.openapi.options.Configurable.reset方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。