@UiHandler("_saveBookmarkAnchor")
void handleShowCustomViewClick(ClickEvent e) {
e.preventDefault();
UrlBuilder b = UrlBuilder.createFromLocation();
String path = Location.getPath();
path = path.replace("bookmark-edit.action", "bookmark-update.action");
b.setPath(path);
String name = _bookmarkName.getText();
if (name.length() > 0)
b.setParameter("name", name);
String[] stopIds = _stopsById.keySet().toArray(new String[0]);
b.setParameter("stopId", stopIds);
boolean allRoutesIncluded = true;
List<String> routeIds = new ArrayList<String>();
for (Map.Entry<String, Boolean> entry : _routeSelectionById.entrySet()) {
if (entry.getValue())
routeIds.add(entry.getKey());
else
allRoutesIncluded = false;
}
if (!allRoutesIncluded) {
String[] routeIdsArray = routeIds.toArray(new String[routeIds.size()]);
b.setParameter("routeId", routeIdsArray);
}
System.out.println(b.buildString());
Location.assign(b.buildString());
}