ItEr32S09ValidacionEProbasFuncionaisItEr31S12: Improvements in keyboard usability when inserting elements into lists
This commit is contained in:
parent
eff3f02618
commit
77844bfd02
5 changed files with 14 additions and 6 deletions
|
|
@ -79,7 +79,7 @@ public interface ILabelTypeModel {
|
|||
/**
|
||||
* Add {@link Label} to {@link LabelType}
|
||||
*/
|
||||
void addLabel();
|
||||
void addLabel(String value);
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ public class LabelTypeCRUDController extends GenericForwardComposer {
|
|||
|
||||
private Grid gridLabels;
|
||||
|
||||
private Textbox newLabelTextbox;
|
||||
|
||||
public LabelTypeCRUDController() {
|
||||
|
||||
}
|
||||
|
|
@ -89,6 +91,8 @@ public class LabelTypeCRUDController extends GenericForwardComposer {
|
|||
gridLabels = (Grid) editWindow.getFellowIfAny("gridLabels");
|
||||
gridLabelTypes = (Grid) listWindow.getFellowIfAny("gridLabelTypes");
|
||||
showListWindow();
|
||||
newLabelTextbox = (Textbox) editWindow
|
||||
.getFellowIfAny("newLabelTextbox");
|
||||
}
|
||||
|
||||
private void showListWindow() {
|
||||
|
|
@ -270,11 +274,12 @@ public class LabelTypeCRUDController extends GenericForwardComposer {
|
|||
|
||||
public void createLabel() {
|
||||
validate();
|
||||
labelTypeModel.addLabel();
|
||||
labelTypeModel.addLabel(newLabelTextbox.getValue());
|
||||
Util.reloadBindings(gridLabels);
|
||||
// After adding a new row, model might be disordered, so we force it to
|
||||
// sort again respecting previous settings
|
||||
forceSortGridLabels();
|
||||
newLabelTextbox.setValue("");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -227,8 +227,8 @@ public class LabelTypeModel implements ILabelTypeModel {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addLabel() {
|
||||
Label label = Label.create("");
|
||||
public void addLabel(String value) {
|
||||
Label label = Label.create(value);
|
||||
label.setType(labelType);
|
||||
labelType.addLabel(label);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,8 +50,11 @@
|
|||
<panel title="${i18n:_('Label list')}"
|
||||
border="normal">
|
||||
<panelchildren>
|
||||
<hbox valign="center">
|
||||
<textbox id="newLabelTextbox" value="" width="200px" onOK="controller.createLabel()" />
|
||||
<button label="${i18n:_('New label')}"
|
||||
onClick="controller.createLabel()" />
|
||||
</hbox>
|
||||
<grid id="gridLabels" height="320px"
|
||||
model="@{controller.labels}" fixedLayout="true">
|
||||
<columns sizable="true">
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<vbox id="criterionsTree">
|
||||
<vbox>
|
||||
<hbox align="center">
|
||||
<textbox value="" id="criterionName" width="200px"/>
|
||||
<textbox value="" id="criterionName" width="200px" onOK="criterionTreeController.addCriterion();"/>
|
||||
<button id="add_new_criterion" label="${i18n:_('New criterion')}"
|
||||
onClick="criterionTreeController.addCriterion();"/>
|
||||
</hbox>
|
||||
|
|
@ -44,4 +44,4 @@
|
|||
</vbox>
|
||||
<separator bar="false" spacing="40px" orient="vertical"/>
|
||||
</panelchildren>
|
||||
</panel>
|
||||
</panel>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue