* Configure the menu that will be the context menu of the themes
*/
private void popupThemes(final TreeNodeThemes record) {
//create an item to add themes
MenuItem openItem = new MenuItem(constants.addTheme(), "edit_add.png");
ClickHandler aux = new ClickHandler() {
@Override
public void onClick(MenuItemClickEvent event) {
createFormTheme(THEMES);
}
};
openItem.addClickHandler(aux);
//item to view the theme selected.
MenuItem viewItem = new MenuItem(constants.viewTheme(), "info.png");
ClickHandler auxView = new ClickHandler() {
@Override
public void onClick(MenuItemClickEvent event) {
to.manageThemeAction(idItemSelected,record.getName(),record.getInfo(), SHOW);
}
};
viewItem.addClickHandler(auxView);
/*
//create an item to add stories
MenuItem saveAsItem = new MenuItem(constants.addStory(), "icono_documento.png");
ClickHandler auxStory = new ClickHandler() {
@Override
public void onClick(MenuItemClickEvent event) {
createFormStory();
}
};
saveAsItem.addClickHandler(auxStory);
*/
MenuItemSeparator separator = new MenuItemSeparator();
/*
//item to copy the subtree selected
MenuItem copyItem = new MenuItem(constants.copy(), "copiar.jpg");
ClickHandler auxCopyTheme = new ClickHandler() {
@Override
public void onClick(MenuItemClickEvent event) {
typeitemToCopy = typeItemSelected;
itemToCopy = idItemSelected;
}
};
copyItem.addClickHandler(auxCopyTheme);
//item to paste the subtree copied
MenuItem pasteItem = new MenuItem(constants.paste(), "pegar.jpg");
ClickHandler auxPasteTheme = new ClickHandler() {
@Override
public void onClick(MenuItemClickEvent event) {
paste(itemToCopy, typeitemToCopy, idItemSelected, typeItemSelected);
}
};
pasteItem.addClickHandler(auxPasteTheme);
*/
//item to modify the story selected
MenuItem modifyItem = new MenuItem(constants.modify(), "configure.png");
ClickHandler auxHandler = new ClickHandler() {
@Override
public void onClick(MenuItemClickEvent event) {
to.manageThemeAction(idItemSelected,record.getName(),record.getInfo(), MODIFY);
}
};
modifyItem.addClickHandler(auxHandler);
//item to delete the story selected
MenuItem projectItem = new MenuItem(constants.delete(), "editdelete.png");
ClickHandler auxdeletetheme = new ClickHandler() {
@Override
public void onClick(MenuItemClickEvent event) {
if (com.google.gwt.user.client.Window.confirm(constants.sureDeleteTheme())) {
to.deleteTheme(idItemSelected);
}