4141import javafx .scene .control .Dialog ;
4242import javafx .scene .control .ListCell ;
4343import javafx .scene .control .ListView ;
44+ import javafx .scene .control .ProgressIndicator ;
4445import javafx .scene .control .SelectionMode ;
4546import javafx .scene .control .TextArea ;
4647import javafx .scene .control .TextField ;
@@ -57,6 +58,7 @@ public class CreateAndSaveMapController {
5758 @ FXML private ListView <Basemap > basemapList ;
5859 @ FXML private ListView <Layer > layersList ;
5960 @ FXML private Button saveButton ;
61+ @ FXML private ProgressIndicator progress ;
6062
6163 private ArcGISMap map ;
6264 private Portal portal ;
@@ -184,6 +186,7 @@ protected void updateItem(Layer layer, boolean empty) {
184186 */
185187 @ FXML
186188 private void saveMap () {
189+ progress .setVisible (true );
187190 try {
188191 ListenableFuture <PortalItem > result = map .saveAsAsync (portal , folderList .getSelectionModel ().getSelectedItem (),
189192 title .getText (), Arrays .asList (tags .getText ().split ("," )), description .getText (), null , true );
@@ -194,9 +197,12 @@ private void saveMap() {
194197 portalItem .getItemId (), Alert .AlertType .INFORMATION );
195198 } catch (InterruptedException | ExecutionException e ) {
196199 showMessage ("Save Unscuccessful" , e .getCause ().getMessage (), Alert .AlertType .ERROR );
200+ } finally {
201+ progress .setVisible (false );
197202 }
198203 });
199204 } catch (Exception e ) {
205+ progress .setVisible (false );
200206 showMessage ("Could not save map" , e .getMessage (), Alert .AlertType .ERROR );
201207 }
202208 }
0 commit comments