@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)); } }
@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()); } } }
@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)); } }