File tree Expand file tree Collapse file tree 1 file changed +19
-6
lines changed
src/main/java/com/esri/samples/map/create_and_save_map Expand file tree Collapse file tree 1 file changed +19
-6
lines changed Original file line number Diff line number Diff line change 1818
1919import javafx .fxml .FXML ;
2020import javafx .fxml .FXMLLoader ;
21+ import javafx .scene .control .Alert ;
2122import javafx .scene .control .ButtonType ;
2223import javafx .scene .control .Dialog ;
2324import javafx .scene .control .TextField ;
@@ -45,20 +46,32 @@ class AuthenticationDialog extends Dialog<OAuthConfiguration> {
4546 loader .setRoot (this );
4647 loader .setController (this );
4748
49+ setTitle ("Authenticate" );
50+
4851 try {
4952 loader .load ();
5053 } catch (Exception e ) {
5154 e .printStackTrace ();
5255 }
5356
5457 setResultConverter (dialogButton -> {
55- try {
56- return dialogButton == continueButton ? new OAuthConfiguration (portalURL .getText (), clientID .getText (),
57- redirectURI .getText ()) : null ;
58- } catch (Exception e ) {
59- return null ;
58+ if (dialogButton == continueButton ) {
59+ if (!portalURL .getText ().equals ("" ) && !clientID .getText ().equals ("" ) && !redirectURI .getText ().equals ("" )) {
60+ try {
61+ return new OAuthConfiguration (portalURL .getText (), clientID .getText (), redirectURI .getText ());
62+ } catch (Exception e ) {
63+ Alert alert = new Alert (Alert .AlertType .ERROR );
64+ alert .setContentText (e .getMessage ());
65+ alert .show ();
66+ }
67+ } else {
68+ Alert alert = new Alert (Alert .AlertType .ERROR );
69+ alert .setContentText ("missing credentials" );
70+ alert .show ();
71+ }
6072 }
73+ return null ;
6174 });
6275 }
6376
64- }
77+ }
You can’t perform that action at this time.
0 commit comments