Fixed focus at textbox on created leaves with the ancestor hours
FEA: ItEr76S13WBSSettingUpBehavior
This commit is contained in:
parent
65aa8f3a8e
commit
b1b1a3146b
1 changed files with 8 additions and 7 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
|
* Copyright (C) 2009-2010 Fundación para o Fomento da Calidade Industrial e
|
||||||
* Desenvolvemento Tecnolóxico de Galicia
|
* Desenvolvemento Tecnolóxico de Galicia
|
||||||
* Copyright (C) 2010-2011 Igalia, S.L.
|
* Copyright (C) 2010-2012 Igalia, S.L.
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as published by
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
|
@ -231,14 +231,14 @@ public abstract class TreeController<T extends ITreeNode<T>> extends
|
||||||
if (tree.getSelectedCount() == 1) {
|
if (tree.getSelectedCount() == 1) {
|
||||||
T node = getSelectedNode();
|
T node = getSelectedNode();
|
||||||
|
|
||||||
if (!node.isEmptyLeaf()) {
|
|
||||||
// Then a new container will be created
|
|
||||||
nameTextbox = getRenderer().getNameTextbox(node);
|
|
||||||
}
|
|
||||||
|
|
||||||
T newNode = getModel().addElementAt(node, name.getValue(),
|
T newNode = getModel().addElementAt(node, name.getValue(),
|
||||||
hours.getValue());
|
hours.getValue());
|
||||||
getRenderer().refreshHoursValueForThisNodeAndParents(newNode);
|
getRenderer().refreshHoursValueForThisNodeAndParents(newNode);
|
||||||
|
|
||||||
|
if (node.isLeaf() && !node.isEmptyLeaf()) {
|
||||||
|
// Then a new container will be created
|
||||||
|
nameTextbox = getRenderer().getNameTextbox(node);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
getModel().addElement(name.getValue(), hours.getValue());
|
getModel().addElement(name.getValue(), hours.getValue());
|
||||||
}
|
}
|
||||||
|
|
@ -250,10 +250,11 @@ public abstract class TreeController<T extends ITreeNode<T>> extends
|
||||||
|
|
||||||
name.setValue("");
|
name.setValue("");
|
||||||
hours.setValue(0);
|
hours.setValue(0);
|
||||||
name.focus();
|
|
||||||
|
|
||||||
if (nameTextbox != null) {
|
if (nameTextbox != null) {
|
||||||
nameTextbox.focus();
|
nameTextbox.focus();
|
||||||
|
} else {
|
||||||
|
name.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue