use of edu.stanford.bmir.protege.web.shared.place.ProjectSettingsPlace in project webprotege by protegeproject.
the class ShowProjectDetailsHandlerImpl method handleShowProjectDetails.
@Override
public void handleShowProjectDetails() {
Place currentPlace = placeController.getWhere();
placeController.goTo(new ProjectSettingsPlace(projectId, Optional.ofNullable(currentPlace)));
}
use of edu.stanford.bmir.protege.web.shared.place.ProjectSettingsPlace in project webprotege by protegeproject.
the class ProjectSettingsPlaceTokenizer_TestCase method shouldGetPlaceFromToken.
@Test
public void shouldGetPlaceFromToken() {
ProjectSettingsPlace p = tokenizer.getPlace("projects/" + PROJECT_ID + "/settings");
assertThat(p, is(not(nullValue())));
assertThat(p.getProjectId().getId(), is(PROJECT_ID));
}
use of edu.stanford.bmir.protege.web.shared.place.ProjectSettingsPlace in project webprotege by protegeproject.
the class ProjectSettingsPlaceTokenizer_TestCase method shouldNotGetPlaceFromMalformedProjectId.
@Test
public void shouldNotGetPlaceFromMalformedProjectId() {
ProjectSettingsPlace p = tokenizer.getPlace("projects/MALFORMED/settings");
assertThat(p, is(nullValue()));
}
use of edu.stanford.bmir.protege.web.shared.place.ProjectSettingsPlace in project webprotege by protegeproject.
the class ProjectSettingsPlaceTokenizer method getPlace.
@Override
public ProjectSettingsPlace getPlace(String token) {
MatchResult matchResult = regExp.exec(token);
if (matchResult == null) {
return null;
}
String projectIdString = matchResult.getGroup(1);
if (ProjectId.isWelFormedProjectId(projectIdString)) {
ProjectId projectId = ProjectId.get(projectIdString);
return new ProjectSettingsPlace(projectId, empty());
} else {
return null;
}
}
Aggregations