Пример #1
0
 @UiHandler("sourceList")
 void onChangeSourceList(ChangeEvent e) {
   Place currentPlace = placeController.getWhere();
   if (currentPlace instanceof PlaceWithSources) {
     PlaceWithSources<?> place = (PlaceWithSources<?>) currentPlace;
     int selectedIndex = sourceList.getSelectedIndex();
     // we were on the example page, we create a new place from the previous one and go to this new
     // place
     placeController.goTo(
         place.createPlace(sourceList.getValue(selectedIndex), selectedIndex > 0));
   }
 }
Пример #2
0
 @UiHandler("exampleLink")
 void onClickExampleLink(ClickEvent e) {
   Place currentPlace = placeController.getWhere();
   if (currentPlace instanceof PlaceWithSources) {
     PlaceWithSources<?> place = (PlaceWithSources<?>) currentPlace;
     if (null != place.getFilename()) {
       // we were on the source page, we create a new place from the previous one and go to this
       // new place
       placeController.goTo(place.createPlace());
     }
   }
 }
Пример #3
0
 @UiHandler("sourceLink")
 void onClickSourceLink(ClickEvent e) {
   Place currentPlace = placeController.getWhere();
   if (currentPlace instanceof PlaceWithSources) {
     PlaceWithSources<?> place = (PlaceWithSources<?>) currentPlace;
     // we were on the example page, we create a new place from the previous one and go to this new
     // place
     placeController.goTo(
         place.createPlace(
             place.getSourceFilename(),
             sourceList.isVisible() && sourceList.getSelectedIndex() > 0));
   }
 }