add default file
[jSite2.git] / src / net / pterodactylus / jsite / project / Project.java
index 04760e2..e6f732b 100644 (file)
@@ -20,6 +20,8 @@
 package net.pterodactylus.jsite.project;
 
 import java.beans.PropertyChangeListener;
+import java.util.HashMap;
+import java.util.Map;
 
 import net.pterodactylus.util.beans.AbstractBean;
 
@@ -46,6 +48,9 @@ public class Project extends AbstractBean {
        /** Name of the “base path” property. */
        public static final String PROPERTY_BASE_PATH = "basePath";
 
+       /** Name of the “default file” property. */
+       public static final String PROPERTY_DEFAULT_FILE = "defaultFile";
+
        /** Internal ID. */
        private String id;
 
@@ -64,6 +69,12 @@ public class Project extends AbstractBean {
        /** The base path of the project. */
        private String basePath;
 
+       /** The default file. */
+       private String defaultFile;
+
+       /** The overrides. */
+       private final Map<String, Override> overrides = new HashMap<String, Override>();
+
        /**
         * Creates a new project.
         */
@@ -208,4 +219,56 @@ public class Project extends AbstractBean {
                fireIfPropertyChanged(PROPERTY_BASE_PATH, oldBasePath, basePath);
        }
 
+       /**
+        * Returns the default file.
+        *
+        * @return The default file
+        */
+       public String getDefaultFile() {
+               return defaultFile;
+       }
+
+       /**
+        * Sets the default file.
+        *
+        * @param defaultFile
+        *            The default file
+        */
+       public void setDefaultFile(String defaultFile) {
+               String oldDefaultFile = this.defaultFile;
+               this.defaultFile = defaultFile;
+               fireIfPropertyChanged(PROPERTY_DEFAULT_FILE, oldDefaultFile, defaultFile);
+       }
+
+       /**
+        * Adds an override for the given file.
+        *
+        * @param filePath
+        *            The file path
+        * @param override
+        *            The override for the file
+        */
+       public void addOverride(String filePath, Override override) {
+               overrides.put(filePath, override);
+       }
+
+       /**
+        * Removes the override for the given file.
+        *
+        * @param filePath
+        *            The file path for which to remove the override
+        */
+       public void removeOverride(String filePath) {
+               overrides.remove(filePath);
+       }
+
+       /**
+        * Returns the list of {@link Override}s.
+        *
+        * @return All overrides
+        */
+       public Map<String, Override> getOverrides() {
+               return overrides;
+       }
+
 }