textBox.addBlurHandler(new BlurHandler()
{
public void onBlur(final BlurEvent event)
{
tab.setTabName(textBox.getText());
StartTabsModel.getInstance().rename(new RenameTabRequest(tab.getId(), textBox.getText()));
getPanel().remove(textBox);
getPanel().add(getLabel());
getPanel().add(menu);
}
});
textBox.addKeyUpHandler(new KeyUpHandler()
{
public void onKeyUp(final KeyUpEvent ev)
{
if (ev.getNativeKeyCode() == KeyCodes.KEY_ENTER && !ev.isAnyModifierKeyDown())
{
tab.setTabName(textBox.getText());
StartTabsModel.getInstance().rename(new RenameTabRequest(tab.getId(), textBox.getText()));
}
}
});
menuItems.addItem("Change Layout", new Command()