Skip to content

Commit

Permalink
Cleanup of illegal document namespace handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
yevster committed Sep 14, 2016
1 parent 655c867 commit 67d252f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/spdxedit/MainSceneController.java
Expand Up @@ -158,14 +158,15 @@ private static TreeItem<Path> getTreeForPath(final Path base) throws IOException
}

public void handleNewDocumentClicked(MouseEvent event){
TextInputDialog dialog = new TextInputDialog();
TextInputDialog dialog = new TextInputDialog("http://url.example.com/spdx/builder");
((Stage)dialog.getDialogPane().getScene().getWindow()).getIcons().addAll(UiUtils.ICON_IMAGE_VIEW.getImage());
dialog.setTitle("New SPDX Document");
dialog.setHeaderText("Enter document namespace");
dialog.setResult("http://url.example.com/spdx/builder");

Optional<String> result = dialog.showAndWait();
while (result.isPresent() && !SpdxLogic.validateDocumentNamespace(result.orElse(""))){
dialog.setContentText(result.orElse("")+ "is not a valid document namespace. Please enter a valid document namespace.");

dialog.setHeaderText("Invalid document namespace. Enter new document namespace.");
result = dialog.showAndWait();
}
if (result.isPresent()){
Expand Down

0 comments on commit 67d252f

Please sign in to comment.