Skip to content

Commit

Permalink
Implement scrollable warning messages in alert boxes (#10700)
Browse files Browse the repository at this point in the history
* Set warning message content within a TextArea object to enable scrolling within the alertbox.

* Modified getErrorMessage() to utilize a newline delimiter for the join function, displaying its contents on separate lines.

* Updated order of import to comply with checkstyle.
  • Loading branch information
garymejia authored Dec 18, 2023
1 parent d9ebef5 commit 2bed3d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/main/java/org/jabref/gui/JabRefDialogService.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import javafx.scene.control.ChoiceDialog;
import javafx.scene.control.DialogPane;
import javafx.scene.control.Label;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextInputDialog;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Region;
Expand Down Expand Up @@ -79,8 +80,12 @@ public JabRefDialogService(Window mainWindow) {
private FXDialog createDialog(AlertType type, String title, String content) {
FXDialog alert = new FXDialog(type, title, true);
alert.setHeaderText(null);
alert.setContentText(content);
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
alert.setResizable(true);

TextArea area = new TextArea(content);

alert.getDialogPane().setContent(area);
alert.initOwner(mainWindow);
return alert;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/logic/importer/ParserResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void setInvalid(boolean invalid) {
}

public String getErrorMessage() {
return String.join(" ", warnings());
return String.join("\n", warnings());
}

public BibDatabaseContext getDatabaseContext() {
Expand Down

0 comments on commit 2bed3d3

Please sign in to comment.