use of edu.stanford.bmir.protege.web.shared.project.HasProjectId in project webprotege by protegeproject.
the class EditProjectTagsUIActionHandler method handleEditProjectTags.
public void handleEditProjectTags() {
Place currentPlace = placeController.getWhere();
if (!(currentPlace instanceof HasProjectId)) {
return;
}
ProjectId projectId = ((HasProjectId) currentPlace).getProjectId();
ProjectTagsPlace projectTagsPlace = new ProjectTagsPlace(projectId, Optional.of(currentPlace));
placeController.goTo(projectTagsPlace);
}
use of edu.stanford.bmir.protege.web.shared.project.HasProjectId in project webprotege by protegeproject.
the class DispatchServiceExecutorImpl method setTemporaryThreadName.
/**
* Sets the name of a thread so that it contains details of the action (and target project) being executed
* @param thread The thread.
* @param action The action.
* @param projectId The optional project id.
*/
private static void setTemporaryThreadName(@Nonnull Thread thread, @Nonnull Action<?> action, @Nullable ProjectId projectId) {
String tempThreadName;
final ProjectId targetProjectId;
if (projectId != null) {
targetProjectId = projectId;
} else if (action instanceof HasProjectId) {
targetProjectId = ((HasProjectId) action).getProjectId();
} else {
targetProjectId = null;
}
if (targetProjectId == null) {
tempThreadName = String.format("[DispatchService] %s", action.getClass().getSimpleName());
} else {
tempThreadName = String.format("[DispatchService] %s %s", action.getClass().getSimpleName(), targetProjectId);
}
thread.setName(tempThreadName);
}
use of edu.stanford.bmir.protege.web.shared.project.HasProjectId in project webprotege by protegeproject.
the class ActiveProjectManagerImpl method getActiveProjectId.
@Nonnull
@Override
public Optional<ProjectId> getActiveProjectId() {
Place place = placeController.getWhere();
if (!(place instanceof HasProjectId)) {
return Optional.empty();
}
HasProjectId projectViewPlace = (HasProjectId) place;
return Optional.of(projectViewPlace.getProjectId());
}
use of edu.stanford.bmir.protege.web.shared.project.HasProjectId in project webprotege by protegeproject.
the class DispatchServiceManager method execute.
@SuppressWarnings("unchecked")
public <A extends Action<R>, R extends Result> void execute(A action, final DispatchServiceCallback<R> callback) {
callback.handleSubmittedForExecution();
if (action instanceof HasProjectId) {
ProjectId projectId = ((HasProjectId) action).getProjectId();
ResultCache resultCache = getResultCache(projectId, eventBus);
Optional<R> result = resultCache.getCachedResult(action);
if (result.isPresent()) {
callback.onSuccess(result.get());
return;
}
}
requestCount++;
GWT.log("[Dispatch] Executing action " + requestCount + " " + action.getClass().getSimpleName());
async.executeAction(action, new AsyncCallbackProxy(action, callback));
}
use of edu.stanford.bmir.protege.web.shared.project.HasProjectId in project webprotege by protegeproject.
the class EditProjectPrefixDeclarationsHandlerImpl method handleEditProjectPrefixes.
@Override
public void handleEditProjectPrefixes() {
Place currentPlace = placeController.getWhere();
if (currentPlace instanceof HasProjectId) {
ProjectId projectId = ((HasProjectId) currentPlace).getProjectId();
ProjectPrefixDeclarationsPlace prefixesPlace = new ProjectPrefixDeclarationsPlace(projectId, Optional.ofNullable(currentPlace));
placeController.goTo(prefixesPlace);
}
}
Aggregations