Skip to content

Commit

Permalink
ACL Viewer add icon
Browse files Browse the repository at this point in the history
  • Loading branch information
an0r0c committed Dec 19, 2020
1 parent 85990b7 commit 3f232e3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/at/esque/kafka/acl/viewer/AclViewerController.java
Expand Up @@ -23,6 +23,8 @@
import org.apache.kafka.common.resource.PatternType;
import org.apache.kafka.common.resource.ResourcePattern;
import org.apache.kafka.common.resource.ResourceType;
import org.kordamp.ikonli.fontawesome.FontAwesome;
import org.kordamp.ikonli.javafx.FontIcon;

import javax.swing.*;
import java.awt.event.MouseEvent;
Expand Down Expand Up @@ -98,8 +100,10 @@ public void initialize() {
public TableRow<Acl> call(TableView<Acl> tableView) {
final TableRow<Acl> row = new TableRow<>();
final ContextMenu rowMenu = new ContextMenu();
MenuItem removeItem = new MenuItem("Delete");
removeItem.setOnAction(new EventHandler<ActionEvent>() {

MenuItem deleteItem = new MenuItem("Delete");
deleteItem.setGraphic(new FontIcon(FontAwesome.TRASH));
deleteItem.setOnAction(new EventHandler<ActionEvent>() {

@Override
public void handle(ActionEvent event) {
Expand All @@ -115,7 +119,7 @@ public void handle(ActionEvent event) {

}
});
rowMenu.getItems().addAll(removeItem);
rowMenu.getItems().addAll(deleteItem);
row.contextMenuProperty().set(rowMenu);

return row;
Expand Down

0 comments on commit 3f232e3

Please sign in to comment.