Skip to content

Commit 67d252f

Browse files
committed
Cleanup of illegal document namespace handling.
1 parent 655c867 commit 67d252f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/spdxedit/MainSceneController.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,15 @@ private static TreeItem<Path> getTreeForPath(final Path base) throws IOException
158158
}
159159

160160
public void handleNewDocumentClicked(MouseEvent event){
161-
TextInputDialog dialog = new TextInputDialog();
161+
TextInputDialog dialog = new TextInputDialog("http://url.example.com/spdx/builder");
162162
((Stage)dialog.getDialogPane().getScene().getWindow()).getIcons().addAll(UiUtils.ICON_IMAGE_VIEW.getImage());
163163
dialog.setTitle("New SPDX Document");
164164
dialog.setHeaderText("Enter document namespace");
165-
dialog.setResult("http://url.example.com/spdx/builder");
165+
166166
Optional<String> result = dialog.showAndWait();
167167
while (result.isPresent() && !SpdxLogic.validateDocumentNamespace(result.orElse(""))){
168-
dialog.setContentText(result.orElse("")+ "is not a valid document namespace. Please enter a valid document namespace.");
168+
169+
dialog.setHeaderText("Invalid document namespace. Enter new document namespace.");
169170
result = dialog.showAndWait();
170171
}
171172
if (result.isPresent()){

0 commit comments

Comments
 (0)