getRows().insertBefore(dragged.getParent().getParent(),
target.getParent().getParent());
}
private void convertLabelToTextfield(final Label label) {
final Textfield textfield = new Textfield(label.getValue());
EventListener labelEditPerformed = new EventListener() {
public void onEvent(Event evt) throws Exception {
String value = textfield.getValue();
label.setValue(value);
((PropertyEditor) textfield.getParent().getNextSibling()
.getFirstChild()).getProperty().setName(value);
ZK.replace(textfield, label);
}
};
textfield.addEventListener(Events.ON_OK, labelEditPerformed);
textfield.addEventListener(Events.ON_BLUR, labelEditPerformed);
ZK.replace(label, textfield);
textfield.focus();
}