+ private void askRouteNameAndPersist(Route committedRoute) {
+ String newName = askRouteName("Confirm Route", committedRoute.getName());
+ if (newName != null) {
+ committedRoute.setName(newName);
+ routeService.persistRoute(committedRoute);
+ } else {
+ routeService.discardRoute(committedRoute);
+ }
+ }
+
+ private boolean askDiscardUnpersistedRoute() {
+ MessageDialog dialog = new MessageDialog(
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ "Discard route",
+ null,
+ "Discard current unpersisted route?",
+ MessageDialog.INFORMATION,
+ 0,
+ new String[] { "OK", "Cancel" });
+ return dialog.open() == Window.OK;
+ }
+