01: /*
02: * Swing Explorer. Tool for developers exploring Java/Swing-based application internals.
03: * Copyright (C) 2008, Maxim Zakharenkov
04: *
05: * This program is free software; you can redistribute it and/or modify
06: * it under the terms of the GNU General Public License as published by
07: * the Free Software Foundation; either version 2 of the License, or
08: * (at your option) any later version.
09: *
10: * This program is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: * GNU General Public License for more details.
14: *
15: * You should have received a copy of the GNU General Public License along
16: * with this program; if not, write to the Free Software Foundation, Inc.,
17: * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18: *
19: * $Header: /cvs/swingexplorer/src/org/swingexplorer/edt_monitor/ActTrace.java,v 1.1 2008/03/07 11:46:52 maxz1 Exp $
20: */
21: package org.swingexplorer.edt_monitor;
22:
23: import java.awt.event.ActionEvent;
24:
25: import javax.swing.JOptionPane;
26:
27: import org.swingexplorer.Problem;
28: import org.swingexplorer.RichAction;
29:
30: /**
31: *
32: * @author Maxim Zakharenkov
33: */
34: public class ActTrace extends RichAction {
35:
36: PNLEDTMonitor owner;
37:
38: public ActTrace(PNLEDTMonitor _owner) {
39: owner = _owner;
40: }
41:
42: public void actionPerformed(ActionEvent e) {
43: Problem[] problems = owner.getSelectedProblems();
44: if (problems == null) {
45: JOptionPane.showMessageDialog(owner,
46: "There are no problems selected");
47: return;
48: }
49:
50: for (Problem curProblem : problems) {
51: System.out.println();
52: System.out.println(curProblem.getProblemDescription());
53: System.out.println(curProblem.getProblemTraceAsString());
54: }
55: }
56: }
|