use of edu.stanford.bmir.protege.web.client.library.popupmenu.PopupMenu in project webprotege by protegeproject.
the class PerspectiveSwitcherViewImpl method handleNewPerspectiveButtonClicked.
@UiHandler("newTabButton")
protected void handleNewPerspectiveButtonClicked(ClickEvent clickEvent) {
if (!addPerspectiveAllowed) {
return;
}
PopupMenu popupMenu = new PopupMenu();
for (final PerspectiveId perspectiveId : bookmarkedPerspectives) {
AbstractUiAction action = new AbstractUiAction(perspectiveId.getId()) {
@Override
public void execute() {
addBookMarkedPerspectiveLinkHandler.handleAddBookmarkedPerspective(perspectiveId);
}
};
action.setEnabled(!displayedPerspectives.contains(perspectiveId));
popupMenu.addItem(action);
}
popupMenu.addSeparator();
popupMenu.addItem(messages.perspective_addBlankTab() + "\u2026", () -> addPerspectiveLinkRequestHandler.handleAddNewPerspectiveLinkRequest());
popupMenu.showRelativeTo(newTabButton);
}
use of edu.stanford.bmir.protege.web.client.library.popupmenu.PopupMenu in project webprotege by protegeproject.
the class ChangeDetailsViewImpl method showRevisionMenu.
@UiHandler("revisionField")
protected void showRevisionMenu(ClickEvent event) {
if (!downloadRevisionVisible && !revertRevisionVisible) {
return;
}
if (!revision.isPresent()) {
return;
}
PopupMenu popupMenu = new PopupMenu();
if (revertRevisionVisible) {
popupMenu.addItem(new AbstractUiAction(messages.change_revertChangesInRevision() + " " + revision.get().getValue()) {
@Override
public void execute() {
revertRevisionHandler.handleRevertRevision(revision.get());
}
});
}
if (downloadRevisionVisible && revertRevisionVisible) {
popupMenu.addSeparator();
}
if (downloadRevisionVisible) {
popupMenu.addItem(new AbstractUiAction(messages.change_downloadRevision() + " " + revision.get().getValue()) {
@Override
public void execute() {
downloadRevisionHandler.handleDownloadRevision(revision.get());
}
});
}
popupMenu.showRelativeTo(revisionField);
}
use of edu.stanford.bmir.protege.web.client.library.popupmenu.PopupMenu in project webprotege by protegeproject.
the class AvailableProjectViewImpl method handleMenuButtonClicked.
@UiHandler("menuButton")
protected void handleMenuButtonClicked(ClickEvent event) {
PopupMenu popupMenu = new PopupMenu();
for (final UIAction action : actions) {
popupMenu.addItem(action);
}
popupMenu.showRelativeTo(menuButton);
}
use of edu.stanford.bmir.protege.web.client.library.popupmenu.PopupMenu in project webprotege by protegeproject.
the class EntityHierarchyContextMenuPresenter method createContextMenu.
private void createContextMenu() {
contextMenu = new PopupMenu();
contextMenu.addItem(createEntityAction);
contextMenu.addItem(deleteEntityAction);
contextMenu.addSeparator();
contextMenu.addItem(editEntityTagsAction);
contextMenu.addSeparator();
contextMenu.addItem(mergeEntitiesAction);
contextMenu.addSeparator();
contextMenu.addItem(messages.tree_pruneBranchToRoot(), this::pruneSelectedNodesToRoot);
contextMenu.addItem(messages.tree_pruneAllBranchesToRoot(), this::pruneToKey);
contextMenu.addItem(messages.tree_clearPruning(), this::clearPruning);
contextMenu.addSeparator();
contextMenu.addItem(messages.showIri(), this::showIriForSelection);
contextMenu.addItem(messages.showDirectLink(), this::showUrlForSelection);
contextMenu.addSeparator();
contextMenu.addItem(messages.refreshTree(), this::handleRefresh);
// This needs tidying somehow. We don't do this for other actions.
mergeEntitiesAction.setEnabled(false);
permissionChecker.hasPermission(MERGE_ENTITIES, mergeEntitiesAction::setEnabled);
editEntityTagsAction.setEnabled(false);
permissionChecker.hasPermission(EDIT_ENTITY_TAGS, editEntityTagsAction::setEnabled);
}
Aggregations