Exemplo n.º 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));
   }
 }
Exemplo n.º 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());
     }
   }
 }
Exemplo n.º 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));
   }
 }