// Create the TextBox element used for non word wrapped Labels
// and add a KeyboardListener for Return and Esc key presses
changeText = new TextBox();
changeText.setStyleName("editableLabel-textBox");
changeText.addKeyboardListener(new KeyboardListenerAdapter()
{
public void onKeyPress (Widget sender, char keyCode, int modifiers)
{
// If return then save, if Esc cancel the change, otherwise do nothing
switch (keyCode) {
case 13:
setTextLabel();
break;
case 27:
cancelLabelChange();
break;
}
}
});
// Create the TextAre element used for word-wrapped Labels
// and add a KeyboardListener for Esc key presses (not return in this case)
changeTextArea = new TextArea();
changeTextArea.setStyleName("editableLabel-textArea");
changeTextArea.addKeyboardListener(new KeyboardListenerAdapter()
{
public void onKeyPress (Widget sender, char keyCode, int modifiers)
{
// If Esc then cancel the change, otherwise do nothing
switch (keyCode) {