Search in sources :

Example 1 with ProjectSettingsPlace

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)));
}
Also used : Place(com.google.gwt.place.shared.Place) ProjectSettingsPlace(edu.stanford.bmir.protege.web.shared.place.ProjectSettingsPlace) ProjectSettingsPlace(edu.stanford.bmir.protege.web.shared.place.ProjectSettingsPlace)

Example 2 with ProjectSettingsPlace

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));
}
Also used : ProjectSettingsPlace(edu.stanford.bmir.protege.web.shared.place.ProjectSettingsPlace) Test(org.junit.Test)

Example 3 with ProjectSettingsPlace

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()));
}
Also used : ProjectSettingsPlace(edu.stanford.bmir.protege.web.shared.place.ProjectSettingsPlace) Test(org.junit.Test)

Example 4 with ProjectSettingsPlace

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;
    }
}
Also used : ProjectId(edu.stanford.bmir.protege.web.shared.project.ProjectId) MatchResult(com.google.gwt.regexp.shared.MatchResult) ProjectSettingsPlace(edu.stanford.bmir.protege.web.shared.place.ProjectSettingsPlace)

Aggregations

ProjectSettingsPlace (edu.stanford.bmir.protege.web.shared.place.ProjectSettingsPlace)4 Test (org.junit.Test)2 Place (com.google.gwt.place.shared.Place)1 MatchResult (com.google.gwt.regexp.shared.MatchResult)1 ProjectId (edu.stanford.bmir.protege.web.shared.project.ProjectId)1