}
private PopupMenu createContextContextMenu(String contextName,
SuperTreeItem contextItem)
{
PopupMenu menu = new PopupMenu();
HTML refresh = new HTML(HTMLHelper.imageWithText(GWT.getModuleBaseURL()
+ "gwtcomp-icons/reload.png", "Refresh"));
ClickListener listener = new ContextOperationListener(
ContextOperationListener.CONTEXT_JIPLETS_REFRESH, contextName,
contextItem);
refresh
.addClickListener(new TreeContextMenuItemListener(menu,
listener));
menu.addMenuItem(refresh);
HTML view = new HTML(HTMLHelper.imageWithText(GWT.getModuleBaseURL()
+ "gwtcomp-icons/view_detailed.png", "View Properties"));
listener = new ContextOperationListener(
ContextOperationListener.CONTEXT_VIEW_PROPERTIES, contextName);
view.addClickListener(new TreeContextMenuItemListener(menu, listener));
menu.addMenuItem(view);
HTML delete = new HTML(HTMLHelper.imageWithText(GWT.getModuleBaseURL()
+ "gwtcomp-icons/editdelete.png", "Remove the Context"));
listener = new ContextOperationListener(
ContextOperationListener.CONTEXT_DELETE, contextName);
delete
.addClickListener(new TreeContextMenuItemListener(menu,
listener));
menu.addMenuItem(delete);
return menu;
}