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); } }
@Override public boolean isModified() { for (Configurable each : myName2Config) { if (each.isModified()) return true; } return false; }
public boolean isModified() { if (!Comparing.equal(mySelectedCompiler, myCompilerConfiguration.getDefaultCompiler())) { return true; } for (Configurable configurable : myConfigurables) { if (configurable.isModified()) { return true; } } return false; }
@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(); } }); }
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); } }
public boolean isModified() { return myConfigurable.isModified(); }