Search in sources :

Example 1 with PopupMenu

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);
}
Also used : AbstractUiAction(edu.stanford.bmir.protege.web.client.action.AbstractUiAction) PerspectiveId(edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId) PopupMenu(edu.stanford.bmir.protege.web.client.library.popupmenu.PopupMenu) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Example 2 with PopupMenu

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);
}
Also used : AbstractUiAction(edu.stanford.bmir.protege.web.client.action.AbstractUiAction) PopupMenu(edu.stanford.bmir.protege.web.client.library.popupmenu.PopupMenu) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Example 3 with PopupMenu

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);
}
Also used : UIAction(edu.stanford.bmir.protege.web.client.action.UIAction) PopupMenu(edu.stanford.bmir.protege.web.client.library.popupmenu.PopupMenu) UiHandler(com.google.gwt.uibinder.client.UiHandler)

Example 4 with PopupMenu

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);
}
Also used : PopupMenu(edu.stanford.bmir.protege.web.client.library.popupmenu.PopupMenu)

Aggregations

PopupMenu (edu.stanford.bmir.protege.web.client.library.popupmenu.PopupMenu)4 UiHandler (com.google.gwt.uibinder.client.UiHandler)3 AbstractUiAction (edu.stanford.bmir.protege.web.client.action.AbstractUiAction)2 UIAction (edu.stanford.bmir.protege.web.client.action.UIAction)1 PerspectiveId (edu.stanford.bmir.protege.web.shared.perspective.PerspectiveId)1