summaryrefslogtreecommitdiff
path: root/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenImportingSettings.java
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenImportingSettings.java')
-rw-r--r--plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenImportingSettings.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenImportingSettings.java b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenImportingSettings.java
index 044796cc8e1f..393319c91b82 100644
--- a/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenImportingSettings.java
+++ b/plugins/maven/src/main/java/org/jetbrains/idea/maven/project/MavenImportingSettings.java
@@ -26,6 +26,7 @@ import org.jetbrains.idea.maven.execution.MavenRunnerSettings;
import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Objects;
import java.util.Set;
public class MavenImportingSettings implements Cloneable {
@@ -61,6 +62,7 @@ public class MavenImportingSettings implements Cloneable {
private boolean downloadDocsAutomatically = false;
private boolean downloadAnnotationsAutomatically = false;
private boolean autoDetectCompiler = true;
+ private boolean importToTreeStructure = false;
private GeneratedSourcesFolder generatedSourcesFolder = GeneratedSourcesFolder.AUTODETECT;
@@ -235,6 +237,16 @@ public class MavenImportingSettings implements Cloneable {
this.autoDetectCompiler = autoDetectCompiler;
}
+ public boolean isImportToTreeStructure() {
+ return importToTreeStructure;
+ }
+
+ public void setImportToTreeStructure(boolean importToTreeStructure) {
+ boolean changedValue = !Objects.equals(this.importToTreeStructure, importToTreeStructure);
+ this.importToTreeStructure = importToTreeStructure;
+ if (changedValue) fireUpdateAllProjectStructure();
+ }
+
@Property
@NotNull
public GeneratedSourcesFolder getGeneratedSourcesFolder() {
@@ -279,6 +291,7 @@ public class MavenImportingSettings implements Cloneable {
if (downloadSourcesAutomatically != that.downloadSourcesAutomatically) return false;
if (downloadAnnotationsAutomatically != that.downloadAnnotationsAutomatically) return false;
if (autoDetectCompiler != that.autoDetectCompiler) return false;
+ if (importToTreeStructure != that.importToTreeStructure) return false;
//if (lookForNested != that.lookForNested) return false;
if (keepSourceFolders != that.keepSourceFolders) return false;
if (excludeTargetFolder != that.excludeTargetFolder) return false;
@@ -318,6 +331,8 @@ public class MavenImportingSettings implements Cloneable {
result <<= 1;
if (autoDetectCompiler) result++;
result <<= 1;
+ if (importToTreeStructure) result++;
+ result <<= 1;
result = 31 * result + (updateFoldersOnImportPhase != null ? updateFoldersOnImportPhase.hashCode() : 0);
result = 31 * result + dedicatedModuleDir.hashCode();
@@ -359,10 +374,18 @@ public class MavenImportingSettings implements Cloneable {
}
}
+ private void fireUpdateAllProjectStructure() {
+ for (Listener each : myListeners) {
+ each.updateAllProjectStructure();
+ }
+ }
+
public interface Listener {
void createModuleGroupsChanged();
void createModuleForAggregatorsChanged();
+
+ void updateAllProjectStructure();
}
}