Both setter and getter should start with word 'add'

This commit is contained in:
Dmitry Trofimov
2014-11-24 21:41:47 +03:00
parent 9154ce7821
commit e521c513d7
7 changed files with 36 additions and 35 deletions
@@ -276,23 +276,23 @@ public class PyIdeCommonOptionsForm implements AbstractPyCommonOptionsForm {
}
@Override
public boolean addContentRoots() {
public boolean shouldAddContentRoots() {
return myAddContentRootsCheckbox.isSelected();
}
@Override
public boolean addSourceRoots() {
public boolean shouldAddSourceRoots() {
return myAddSourceRootsCheckbox.isSelected();
}
@Override
public void addContentRoots(boolean add) {
myAddContentRootsCheckbox.setSelected(add);
public void setAddContentRoots(boolean flag) {
myAddContentRootsCheckbox.setSelected(flag);
}
@Override
public void addSourceRoots(boolean add) {
myAddSourceRootsCheckbox.setSelected(add);
public void setAddSourceRoots(boolean flag) {
myAddSourceRootsCheckbox.setSelected(flag);
}
private void createUIComponents() {
@@ -60,8 +60,9 @@ public interface AbstractPythonRunConfigurationParams {
void setMappingSettings(@Nullable PathMappingSettings mappingSettings);
boolean addContentRoots();
boolean addSourceRoots();
void addContentRoots(boolean add);
void addSourceRoots(boolean add);
boolean shouldAddContentRoots();
boolean shouldAddSourceRoots();
void setAddContentRoots(boolean flag);
void setAddSourceRoots(boolean flag);
}
@@ -255,23 +255,23 @@ public class PyPluginCommonOptionsForm implements AbstractPyCommonOptionsForm {
}
@Override
public boolean addContentRoots() {
public boolean shouldAddContentRoots() {
return myAddContentRootsCheckbox.isSelected();
}
@Override
public boolean addSourceRoots() {
public boolean shouldAddSourceRoots() {
return myAddSourceRootsCheckbox.isSelected();
}
@Override
public void addContentRoots(boolean add) {
myAddContentRootsCheckbox.setSelected(add);
public void setAddContentRoots(boolean flag) {
myAddContentRootsCheckbox.setSelected(flag);
}
@Override
public void addSourceRoots(boolean add) {
myAddSourceRootsCheckbox.setSelected(add);
public void setAddSourceRoots(boolean flag) {
myAddSourceRootsCheckbox.setSelected(flag);
}
}
@@ -122,8 +122,8 @@ public class PyConsoleOptions implements PersistentStateComponent<PyConsoleOptio
myModuleName = form.getModule() == null ? null : form.getModule().getName();
myWorkingDirectory = form.getWorkingDirectory();
myAddContentRoots = form.addContentRoots();
myAddSourceRoots = form.addSourceRoots();
myAddContentRoots = form.shouldAddContentRoots();
myAddSourceRoots = form.shouldAddSourceRoots();
myMappings = form.getMappingSettings() == null ? new PathMappingSettings() : form.getMappingSettings();
}
@@ -132,8 +132,8 @@ public class PyConsoleOptions implements PersistentStateComponent<PyConsoleOptio
!myInterpreterOptions.equals(form.getInterpreterOptions()) ||
!myEnvs.equals(form.getEnvs()) ||
myUseModuleSdk != form.isUseModuleSdk() ||
myAddContentRoots != form.addContentRoots() ||
myAddSourceRoots != form.addSourceRoots()
myAddContentRoots != form.shouldAddContentRoots() ||
myAddSourceRoots != form.shouldAddSourceRoots()
|| !ComparatorUtil.equalsNullable(myModuleName, form.getModule() == null ? null : form.getModule().getName())
|| !myWorkingDirectory.equals(form.getWorkingDirectory())
|| !myMappings.equals(form.getMappingSettings());
@@ -144,8 +144,8 @@ public class PyConsoleOptions implements PersistentStateComponent<PyConsoleOptio
form.setInterpreterOptions(myInterpreterOptions);
form.setSdkHome(mySdkHome);
form.setUseModuleSdk(myUseModuleSdk);
form.addContentRoots(myAddContentRoots);
form.addSourceRoots(myAddSourceRoots);
form.setAddContentRoots(myAddContentRoots);
form.setAddSourceRoots(myAddSourceRoots);
boolean moduleWasAutoselected = false;
if (form.isUseModuleSdk() != myUseModuleSdk) {
@@ -298,23 +298,23 @@ public abstract class AbstractPythonRunConfiguration<T extends AbstractRunConfig
}
@Override
public boolean addContentRoots() {
public boolean shouldAddContentRoots() {
return myAddContentRoots;
}
@Override
public boolean addSourceRoots() {
public boolean shouldAddSourceRoots() {
return myAddSourceRoots;
}
@Override
public void addSourceRoots(boolean add) {
myAddSourceRoots = add;
public void setAddSourceRoots(boolean flag) {
myAddSourceRoots = flag;
}
@Override
public void addContentRoots(boolean add) {
myAddContentRoots = add;
public void setAddContentRoots(boolean flag) {
myAddContentRoots = flag;
}
public static void copyParams(AbstractPythonRunConfigurationParams source, AbstractPythonRunConfigurationParams target) {
@@ -326,8 +326,8 @@ public abstract class AbstractPythonRunConfiguration<T extends AbstractRunConfig
target.setModule(source.getModule());
target.setUseModuleSdk(source.isUseModuleSdk());
target.setMappingSettings(source.getMappingSettings());
target.addContentRoots(source.addContentRoots());
target.addSourceRoots(source.addSourceRoots());
target.setAddContentRoots(source.shouldAddContentRoots());
target.setAddSourceRoots(source.shouldAddSourceRoots());
}
/**
@@ -333,7 +333,7 @@ public abstract class PythonCommandLineState extends CommandLineState {
protected Collection<String> collectPythonPath() {
final Module module = myConfig.getModule();
Set<String> pythonPath = Sets.newHashSet(collectPythonPath(module, myConfig.addContentRoots(), myConfig.addSourceRoots()));
Set<String> pythonPath = Sets.newHashSet(collectPythonPath(module, myConfig.shouldAddContentRoots(), myConfig.shouldAddSourceRoots()));
if (isDebug() && getSdkFlavor() instanceof JythonSdkFlavor) { //that fixes Jython problem changing sys.argv on execfile, see PY-8164
pythonPath.add(PythonHelpersLocator.getHelperPath("pycharm"));
@@ -140,22 +140,22 @@ public class PythonTestRunConfigurationForm implements AbstractPythonTestRunConf
@Override
public boolean addContentRoots() {
return myCommonOptionsForm.addContentRoots();
return myCommonOptionsForm.shouldAddContentRoots();
}
@Override
public boolean addSourceRoots() {
return myCommonOptionsForm.addSourceRoots();
return myCommonOptionsForm.shouldAddSourceRoots();
}
@Override
public void addContentRoots(boolean addContentRoots) {
myCommonOptionsForm.addContentRoots(addContentRoots);
myCommonOptionsForm.setAddContentRoots(addContentRoots);
}
@Override
public void addSourceRoots(boolean addSourceRoots) {
myCommonOptionsForm.addSourceRoots(addSourceRoots);
myCommonOptionsForm.setAddSourceRoots(addSourceRoots);
}
public String getFolderName() {