ItEr14S13RFComportamentoGraficoPlanificador: When a task is added the task name receives focus and the viewport scrolls to show it.
This commit is contained in:
parent
f4f59470c8
commit
9f7024b9d8
2 changed files with 14 additions and 4 deletions
|
|
@ -50,7 +50,8 @@ public class ListDetails extends HtmlMacroComponent {
|
|||
newTask.setName("Nova Tarefa");
|
||||
newTask.setBeginDate(new Date());
|
||||
newTask.setEndDate(threeMonthsLater(newTask.getBeginDate()));
|
||||
addTask(newTask);
|
||||
TaskDetail newDetail = addTask(newTask);
|
||||
newDetail.receiveFocus();
|
||||
getPlanner().addTask(newTask);
|
||||
}
|
||||
|
||||
|
|
@ -69,10 +70,11 @@ public class ListDetails extends HtmlMacroComponent {
|
|||
}
|
||||
}
|
||||
|
||||
private void addTask(TaskBean taskBean) {
|
||||
private TaskDetail addTask(TaskBean taskBean) {
|
||||
TaskDetail taskDetail = TaskDetail.create(taskBean);
|
||||
appendChild(taskDetail);
|
||||
taskDetail.afterCompose();
|
||||
return taskDetail;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,14 +133,22 @@ public class TaskDetail extends HtmlMacroComponent implements AfterCompose {
|
|||
public void focusGoUp(int position) {
|
||||
TaskDetail aboveDetail = getAboveDetail();
|
||||
if (aboveDetail != null) {
|
||||
aboveDetail.getTextBoxes()[position].focus();
|
||||
aboveDetail.receiveFocus(position);
|
||||
}
|
||||
}
|
||||
|
||||
public void receiveFocus() {
|
||||
receiveFocus(0);
|
||||
}
|
||||
|
||||
public void receiveFocus(int position) {
|
||||
this.getTextBoxes()[position].focus();
|
||||
}
|
||||
|
||||
public void focusGoDown(int position) {
|
||||
TaskDetail belowDetail = getBelowDetail();
|
||||
if (belowDetail != null) {
|
||||
belowDetail.getTextBoxes()[position].focus();
|
||||
belowDetail.receiveFocus(position);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue