@@ -26,6 +26,10 @@ public List<JMenuItem> createMenuItems(
26
26
final IContextMenuInvocation invocation ) {
27
27
List <JMenuItem > list ;
28
28
list = new ArrayList <JMenuItem >();
29
+
30
+ if (invocation .getInvocationContext () != IContextMenuInvocation .CONTEXT_MESSAGE_EDITOR_REQUEST && invocation .getInvocationContext () != IContextMenuInvocation .CONTEXT_MESSAGE_VIEWER_REQUEST ){
31
+ return list ;
32
+ }
29
33
JMenuItem item = new JMenuItem ("Parse WSDL" );
30
34
31
35
item .addMouseListener (new MouseListener () {
@@ -36,16 +40,17 @@ public void mouseClicked(MouseEvent e) {
36
40
37
41
38
42
public void mousePressed (MouseEvent e ) {
43
+
44
+ }
45
+
46
+
47
+ public void mouseReleased (MouseEvent e ) {
39
48
WSDLParser parser = new WSDLParser (helpers , tab );
40
49
try {
41
50
new Worker (parser ,invocation , tab , callbacks ).execute ();
42
51
} catch (Exception e1 ) {
43
52
e1 .printStackTrace ();
44
53
}
45
- }
46
-
47
-
48
- public void mouseReleased (MouseEvent e ) {
49
54
50
55
}
51
56
@@ -69,14 +74,14 @@ public void mouseExited(MouseEvent e) {
69
74
class Worker extends SwingWorker <Void ,Void > {
70
75
71
76
private JDialog dialog = new JDialog ();
72
- private JProgressBar progressBar = new JProgressBar ();
73
77
private WSDLParser parser ;
74
78
private IContextMenuInvocation invocation ;
75
79
private WSDLParserTab tab ;
76
80
private IBurpExtenderCallbacks callbacks ;
77
81
private int status ;
78
82
79
83
public Worker (WSDLParser parser , IContextMenuInvocation invocation , WSDLParserTab tab , IBurpExtenderCallbacks callbacks ) {
84
+ JProgressBar progressBar = new JProgressBar ();
80
85
progressBar .setString ("Parsing WSDL" );
81
86
progressBar .setStringPainted (true );
82
87
progressBar .setIndeterminate (true );
@@ -101,9 +106,7 @@ protected Void doInBackground() throws Exception {
101
106
protected void done () {
102
107
dialog .dispose ();
103
108
if (status == -1 ) {
104
-
105
109
JOptionPane .showMessageDialog (tab .getUiComponent ().getParent (), "Error: Can't Read Response" );
106
-
107
110
} else if (status == -2 ){
108
111
JOptionPane .showMessageDialog (tab .getUiComponent ().getParent (), "Error: Not a WSDL" );
109
112
} else if (status == -3 ){
0 commit comments