import java.util.List;
import java.util.Map;
+import net.pterodactylus.jsite.util.IdGenerator;
import net.pterodactylus.util.beans.AbstractBean;
+import net.pterodactylus.util.number.Hex;
/**
* Container for project information. A Project is capable of notifying
/** Name of the “default file” property. */
public static final String PROPERTY_DEFAULT_FILE = "defaultFile";
+ /** Name of the “node” property. */
+ public static final String PROPERTY_NODE = "node";
+
/** Internal ID. */
private String id;
/** The overrides. */
private final Map<String, FileOverride> fileOverrides = new HashMap<String, FileOverride>();
+ /** The default node to insert to. */
+ private Node node;
+
/** The current root project file. */
private ProjectFileImpl rootProjectFile;
* Creates a new project.
*/
public Project() {
- /* do nothing. */
+ id = Hex.toHex(IdGenerator.generateId());
}
/**
* @param project
*/
Project(Project project) {
+ this();
this.name = project.name;
this.description = project.description;
this.publicKey = project.publicKey;
return currentProjectFile;
}
+ /**
+ * Returns the default node to insert this project to.
+ *
+ * @return The node to insert this project to
+ */
+ public Node getNode() {
+ return node;
+ }
+
+ /**
+ * Sets the default node to insert this project to.
+ *
+ * @param node
+ * The node to insert this project to
+ */
+ public void setNode(Node node) {
+ Node oldNode = this.node;
+ this.node = node;
+ fireIfPropertyChanged(PROPERTY_NODE, oldNode, node);
+ }
+
//
// PRIVATE METHODS
//