How to read the due date in newly created tasks? [message #599454] |
Tue, 06 October 2009 15:33 |
maarten meijer Messages: 146 Registered: July 2009 |
Senior Member |
|
|
Hi,
I working on some issues raised by users beta version of Industrial SQL
Connector.
See bug 184532: [connector] Generic SQL connector
https://bugs.eclipse.org/bugs/show_bug.cgi?id=184532
On a newly created bug I have a field for the Due Date that I can set.
When I press submit, at some point I call myTaskDataHandler:
public RepositoryResponse postTaskData(TaskRepository repository,
TaskData taskData, Set<TaskAttribute> oldAttributes,
IProgressMonitor monitor) throws CoreException {
and determine whether it is a new task, I then try to get the value set
in TaskAttribute.DATE_DUE
....
taskDto.setDueDate(safeDate(taskData, TaskAttribute.DATE_DUE));
....
but the value of that attribute is not set at this stage, so how can I
retrieve it?
/**
* @param taskData
* @param key specifies {@link TaskAttribute}
* @return the Date if the attribute exists, or null if it does not exist
*/
private Date safeDate(TaskData taskData, String key) {
TaskAttribute attribute = taskData.getRoot().getMappedAttribute(key);
if (attribute != null) {
return taskData.getAttributeMapper().getDateValue(attribute);
}
return null;
}
Where can I find how to do this?
Maarten Meijer
|
|
|
Powered by
FUDForum. Page generated in 0.03648 seconds