-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change checkCompatibility to use verbose mode
Added very basic dialog to display messages retuned by verbose check prevent exceptions from opening very large alert windows
- Loading branch information
Showing
2 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/main/java/at/esque/kafka/alerts/IncompatibleSchemaAlert.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package at.esque.kafka.alerts; | ||
|
||
import at.esque.kafka.Main; | ||
import at.esque.kafka.controls.FilterableListView; | ||
import javafx.scene.control.Alert; | ||
import javafx.scene.control.Label; | ||
import javafx.scene.layout.BorderPane; | ||
import javafx.stage.Window; | ||
|
||
import java.util.List; | ||
|
||
public class IncompatibleSchemaAlert { | ||
public static void show(List<String> messages, Window owner) { | ||
Alert alert = new Alert(Alert.AlertType.WARNING); | ||
alert.setTitle("Schema Incompatible"); | ||
alert.setHeaderText("Incompatibility Information"); | ||
alert.setResizable(true); | ||
Main.applyIcon(alert); | ||
Main.applyStylesheet(alert.getDialogPane().getScene()); | ||
FilterableListView<String> messageView = new FilterableListView<>(); | ||
messageView.setAddButtonVisible(false); | ||
messageView.setRefreshButtonVisible(false); | ||
messageView.setItems(messages); | ||
|
||
BorderPane borderPane = new BorderPane(); | ||
borderPane.setCenter(messageView); | ||
borderPane.setTop(new Label("Messages")); | ||
borderPane.setMaxWidth(Double.MAX_VALUE); | ||
borderPane.setMaxHeight(Double.MAX_VALUE); | ||
borderPane.setPrefSize(800, 600); | ||
|
||
|
||
alert.getDialogPane().setContent(borderPane); | ||
|
||
if (owner != null) { | ||
alert.initOwner(owner); | ||
} | ||
|
||
alert.show(); | ||
} | ||
} |