コード例 #1
0
  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);
    }
  }
コード例 #2
0
  @Override
  public boolean isModified() {
    for (Configurable each : myName2Config) {
      if (each.isModified()) return true;
    }

    return false;
  }
コード例 #3
0
ファイル: JavaCompilersTab.java プロジェクト: jexp/idea2
 public boolean isModified() {
   if (!Comparing.equal(mySelectedCompiler, myCompilerConfiguration.getDefaultCompiler())) {
     return true;
   }
   for (Configurable configurable : myConfigurables) {
     if (configurable.isModified()) {
       return true;
     }
   }
   return false;
 }
コード例 #4
0
  @Override
  public void apply() throws ConfigurationException {
    for (Configurable each : myName2Config) {
      if (each instanceof BaseStructureConfigurable && each.isModified()) {
        ((BaseStructureConfigurable) each).checkCanApply();
      }
    }
    for (Configurable each : myName2Config) {
      if (each.isModified()) {
        each.apply();
      }
    }

    myContext.getDaemonAnalyzer().clearCaches();
    SwingUtilities.invokeLater(
        new Runnable() {
          public void run() {
            BuildManager.getInstance().scheduleAutoMake();
          }
        });
  }
コード例 #5
0
  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);
    }
  }
コード例 #6
0
 public boolean isModified() {
   return myConfigurable.isModified();
 }