Skip to content

Commit

Permalink
LogListener: add context menu for copy
Browse files Browse the repository at this point in the history
This enables copying/clearing lines
by right clicking on the lines
in the log viewer.
  • Loading branch information
pjonsson committed Jan 7, 2024
1 parent be76fec commit 31caaaa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions java/org/contikios/cooja/plugins/LogListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,14 @@ public void mouseClicked(MouseEvent e) {
gui.signalMoteHighlight(d.ev.getMote());
}
});
// Copy options on right click popup menu.
var popupCopyMenu = new JPopupMenu("Copy");
popupCopyMenu.add(new JMenuItem(copyAllAction));
popupCopyMenu.add(new JMenuItem(copyAllMessagesAction));
popupCopyMenu.add(new JMenuItem(copyAction));
popupCopyMenu.addSeparator();
popupCopyMenu.add(new JMenuItem(clearAction));
logTable.setComponentPopupMenu(popupCopyMenu);

/* Automatically update column widths */
final TableColumnAdjuster adjuster = new TableColumnAdjuster(logTable);
Expand Down

0 comments on commit 31caaaa

Please sign in to comment.