String oldLabel = element.getTextContent();
callback.onBeforeMutation(node);
// Make a temporary text input box to grab user input, and place it inside
// the label element.
InputElement input = Elements.createInputElement();
if (css != null) {
input.setClassName(css.nodeNameInput());
}
input.setType("text");
input.setValue(oldLabel);
// Wipe the content from the element.
element.setTextContent("");
// Attach the temporary input box.
element.appendChild(input);
input.focus();
input.select();
// If we hit enter, commit the action.
input.addEventListener(Event.KEYUP, keyListener, false);
// If we lose focus, commit the action.
input.addEventListener(Event.BLUR, blurListener, false);
state = new State<D>(node, callback, input, oldLabel);
}