Skip to content

Commit

Permalink
Add double click listener for topics
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Doubrava committed Jun 15, 2022
1 parent d2b2550 commit ae9ed1b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/at/esque/kafka/Controller.java
Expand Up @@ -50,6 +50,7 @@
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
Expand All @@ -71,6 +72,8 @@
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleButton;
import javafx.scene.image.Image;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
import javafx.stage.DirectoryChooser;
import javafx.stage.FileChooser;
import javafx.stage.Modality;
Expand Down Expand Up @@ -481,6 +484,13 @@ private ListCell<String> topicListCellFactory() {
cell.setContextMenu(contextMenu);
}
});

cell.setOnMouseClicked(event -> {
if(event.getButton() == MouseButton.PRIMARY && event.getClickCount() == 2) {
this.getMessagesClick(new ActionEvent(event.getSource(), event.getTarget()));
}
});

return cell;
}

Expand Down

0 comments on commit ae9ed1b

Please sign in to comment.