ItEr31S12ValidacionEProbasFuncionaisItEr30S17: setStartDate now returns the new length
This commit is contained in:
parent
9ebde6eede
commit
9318fe3c1c
4 changed files with 18 additions and 5 deletions
|
|
@ -77,8 +77,9 @@ public class DefaultFundamentalProperties implements ITaskFundamentalProperties
|
|||
return beginDate;
|
||||
}
|
||||
|
||||
public void setBeginDate(Date beginDate) {
|
||||
public long setBeginDate(Date beginDate) {
|
||||
this.beginDate = beginDate;
|
||||
return lengthMilliseconds;
|
||||
}
|
||||
|
||||
public long getLengthMilliseconds() {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,12 @@ public interface ITaskFundamentalProperties {
|
|||
|
||||
public void setName(String name);
|
||||
|
||||
public void setBeginDate(Date beginDate);
|
||||
/**
|
||||
* Sets the beginDate. As result of this, the length of the task can change.
|
||||
* So the new value is returned
|
||||
* @return the new length
|
||||
*/
|
||||
public long setBeginDate(Date beginDate);
|
||||
|
||||
public Date getBeginDate();
|
||||
|
||||
|
|
|
|||
|
|
@ -97,11 +97,13 @@ public abstract class Task implements ITaskFundamentalProperties {
|
|||
previousValue, name);
|
||||
}
|
||||
|
||||
public void setBeginDate(Date beginDate) {
|
||||
public long setBeginDate(Date beginDate) {
|
||||
Date previousValue = fundamentalProperties.getBeginDate();
|
||||
fundamentalProperties.setBeginDate(beginDate);
|
||||
long oldLength = fundamentalProperties.getLengthMilliseconds();
|
||||
fundamentalPropertiesListeners.firePropertyChange("beginDate",
|
||||
previousValue, fundamentalProperties.getBeginDate());
|
||||
fireLengthMilliseconds(oldLength);
|
||||
return fundamentalProperties.getLengthMilliseconds();
|
||||
}
|
||||
|
||||
public Date getBeginDate() {
|
||||
|
|
@ -111,6 +113,10 @@ public abstract class Task implements ITaskFundamentalProperties {
|
|||
public void setLengthMilliseconds(long lengthMilliseconds) {
|
||||
long previousValue = fundamentalProperties.getLengthMilliseconds();
|
||||
fundamentalProperties.setLengthMilliseconds(lengthMilliseconds);
|
||||
fireLengthMilliseconds(previousValue);
|
||||
}
|
||||
|
||||
private void fireLengthMilliseconds(long previousValue) {
|
||||
fundamentalPropertiesListeners.firePropertyChange("lengthMilliseconds",
|
||||
previousValue, fundamentalProperties.getLengthMilliseconds());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,9 +118,10 @@ public class TaskElementAdapter implements ITaskElementAdapter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void setBeginDate(Date beginDate) {
|
||||
public long setBeginDate(Date beginDate) {
|
||||
taskElement.setStartDate(beginDate);
|
||||
updateEndDate();
|
||||
return lengthMilliseconds;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue