Button saveButton = new Button("Save");
buttonsPanel.add(saveButton);
saveButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
origDialog.hide();
MenuItem item = menuBar.getMenuItem(index);
item.setHTML(nameTextArea.getText());
if(menuBar.getCommandJs().containsKey(index))
{
menuBar.getCommandJs().put(index, jsTextArea.getText());