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.setName("Nova Tarefa");
|
||||||
newTask.setBeginDate(new Date());
|
newTask.setBeginDate(new Date());
|
||||||
newTask.setEndDate(threeMonthsLater(newTask.getBeginDate()));
|
newTask.setEndDate(threeMonthsLater(newTask.getBeginDate()));
|
||||||
addTask(newTask);
|
TaskDetail newDetail = addTask(newTask);
|
||||||
|
newDetail.receiveFocus();
|
||||||
getPlanner().addTask(newTask);
|
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);
|
TaskDetail taskDetail = TaskDetail.create(taskBean);
|
||||||
appendChild(taskDetail);
|
appendChild(taskDetail);
|
||||||
taskDetail.afterCompose();
|
taskDetail.afterCompose();
|
||||||
|
return taskDetail;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,14 +133,22 @@ public class TaskDetail extends HtmlMacroComponent implements AfterCompose {
|
||||||
public void focusGoUp(int position) {
|
public void focusGoUp(int position) {
|
||||||
TaskDetail aboveDetail = getAboveDetail();
|
TaskDetail aboveDetail = getAboveDetail();
|
||||||
if (aboveDetail != null) {
|
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) {
|
public void focusGoDown(int position) {
|
||||||
TaskDetail belowDetail = getBelowDetail();
|
TaskDetail belowDetail = getBelowDetail();
|
||||||
if (belowDetail != null) {
|
if (belowDetail != null) {
|
||||||
belowDetail.getTextBoxes()[position].focus();
|
belowDetail.receiveFocus(position);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue