예제 #1
0
 /** Gets the String value of the Command for deleting allocations. */
 public String getString() {
   return "the deletion of an Allocation for \""
       + team.getShortName()
       + "\" on \""
       + project.getShortName()
       + "\"";
 }
예제 #2
0
  /**
   * Method for creating an XML element for the Allocation within report generation
   *
   * @return element for XML generation
   */
  @Override
  public Element generateXML() {
    Element allocationElement = ReportGenerator.doc.createElement("allocation");

    // WorkSpace Elements
    Element allocationID = ReportGenerator.doc.createElement("ID");
    allocationID.appendChild(ReportGenerator.doc.createTextNode(String.valueOf(id)));
    allocationElement.appendChild(allocationID);

    Element allocatedTeam = ReportGenerator.doc.createElement("team-name");
    allocatedTeam.appendChild(ReportGenerator.doc.createTextNode(team.toString()));
    allocationElement.appendChild(allocatedTeam);

    Element allocatedProject = ReportGenerator.doc.createElement("project-name");
    allocatedProject.appendChild(ReportGenerator.doc.createTextNode(project.toString()));
    allocationElement.appendChild(allocatedProject);

    Element allocationStartDate = ReportGenerator.doc.createElement("allocation-start-date");
    allocationStartDate.appendChild(
        ReportGenerator.doc.createTextNode(getStartDate().format(Global.dateFormatter)));
    allocationElement.appendChild(allocationStartDate);

    Element allocationEndDate = ReportGenerator.doc.createElement("allocation-end-date");
    allocationEndDate.appendChild(
        ReportGenerator.doc.createTextNode(getEndDate().format(Global.dateFormatter)));
    allocationElement.appendChild(allocationEndDate);

    return allocationElement;
  }
예제 #3
0
 /** Undoes the command */
 public void undo() {
   team.getProjectAllocations().add(allocation);
   project.getTeamAllocations().add(allocation);
 }
예제 #4
0
 /** Executes the command */
 public void execute() {
   team.getProjectAllocations().remove(allocation);
   project.getTeamAllocations().remove(allocation);
 }