Skip to content

Commit

Permalink
'#1866: Double click in the bookmarks list opens edit dialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Sep 12, 2023
1 parent 31c19d3 commit 64e72d4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions iped-app/src/main/java/iped/app/ui/BookmarksManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -224,6 +226,17 @@ private BookmarksManager() {
list.removeKeyListener(kl);
}
list.addKeyListener(this);
list.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
// Double click in the list opens edit dialog
if (e.getClickCount() == 2 && e.getButton() == MouseEvent.BUTTON1) {
if (list.getSelectedIndices().length == 1) {
actionPerformed(new ActionEvent(butEdit, 0, ""));
}
}
}
});
list.setCellRenderer(new BookmarkListRenderer());

dialog.setLocationRelativeTo(App.get());
Expand Down

0 comments on commit 64e72d4

Please sign in to comment.