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());
}
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);
}
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);
}
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);
}
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;
}
Aggregations