From 01a1fb7751cc08b79253fbbeefd96a6b8e3c53e4 Mon Sep 17 00:00:00 2001 From: Wolf Posdorfer Date: Mon, 21 Mar 2011 15:08:48 +0000 Subject: [PATCH] added Button to clear "All Packets" Tab git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@12152 b35dd754-fafc-0310-a699-88a17e54d16e --- .../smackx/debugger/EnhancedDebugger.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/source/org/jivesoftware/smackx/debugger/EnhancedDebugger.java b/source/org/jivesoftware/smackx/debugger/EnhancedDebugger.java index 8f490229a..1c7d8a55f 100644 --- a/source/org/jivesoftware/smackx/debugger/EnhancedDebugger.java +++ b/source/org/jivesoftware/smackx/debugger/EnhancedDebugger.java @@ -316,7 +316,27 @@ public class EnhancedDebugger implements SmackDebugger { menu.add(menuItem1); // Add listener to the text area so the popup menu can come up. messageTextArea.addMouseListener(new PopupListener(menu)); - allPane.setBottomComponent(new JScrollPane(messageTextArea)); + JPanel sublayout = new JPanel(new BorderLayout()); + sublayout.add(new JScrollPane(messageTextArea), BorderLayout.CENTER); + + JButton clearb = new JButton("Clear All Packets"); + + clearb.addActionListener(new AbstractAction() { + private static final long serialVersionUID = -8576045822764763613L; + + @Override + public void actionPerformed(ActionEvent e) { + for(int i=0; i< messagesTable.getRowCount();i++) + { + messagesTable.removeRow(i); + } + + } + }); + + sublayout.add(clearb, BorderLayout.NORTH); + allPane.setBottomComponent(sublayout); + allPane.setDividerLocation(150); tabbedPane.add("All Packets", allPane);