Search in sources :

Example 1 with AbstractUiAction

use of edu.stanford.bmir.protege.web.client.action.AbstractUiAction in project webprotege by protegeproject.

the class AvailableProjectPresenter method addTrashAction.

private void addTrashAction() {
    String trashActionLabel;
    if (project.isInTrash()) {
        trashActionLabel = "Remove from trash";
    } else {
        trashActionLabel = "Move to trash";
    }
    AbstractUiAction trashAction = new AbstractUiAction(trashActionLabel) {

        @Override
        public void execute() {
            if (project.isInTrash()) {
                trashManagerRequestHandler.handleRemoveProjectFromTrash(project.getProjectId());
            } else {
                trashManagerRequestHandler.handleMoveProjectToTrash(project.getProjectId());
            }
        }
    };
    view.addAction(trashAction);
    trashAction.setEnabled(project.isTrashable());
}
Also used : AbstractUiAction(edu.stanford.bmir.protege.web.client.action.AbstractUiAction)

Example 2 with AbstractUiAction

use of edu.stanford.bmir.protege.web.client.action.AbstractUiAction in project webprotege by protegeproject.

the class AvailableProjectPresenter method addDowloadAction.

private void addDowloadAction() {
    AbstractUiAction downloadAction = new AbstractUiAction("Download") {

        @Override
        public void execute() {
            downloadProjectRequestHandler.handleProjectDownloadRequest(project.getProjectId());
        }
    };
    downloadAction.setEnabled(project.isDownloadable());
    view.addAction(downloadAction);
}
Also used : AbstractUiAction(edu.stanford.bmir.protege.web.client.action.AbstractUiAction)

Example 3 with AbstractUiAction

use of edu.stanford.bmir.protege.web.client.action.AbstractUiAction 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 4 with AbstractUiAction

use of edu.stanford.bmir.protege.web.client.action.AbstractUiAction 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 5 with AbstractUiAction

use of edu.stanford.bmir.protege.web.client.action.AbstractUiAction in project webprotege by protegeproject.

the class PopupMenu method addItem.

public UIAction addItem(final String label, final Runnable handler) {
    AbstractUiAction action = new AbstractUiAction(label) {

        @Override
        public void execute() {
            handler.run();
        }
    };
    addItem(action);
    return action;
}
Also used : AbstractUiAction(edu.stanford.bmir.protege.web.client.action.AbstractUiAction)

Aggregations

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