(IContextMenuInvocation invocation)
| 34 | |
| 35 | //创建右键菜单 |
| 36 | public List<JMenuItem> createMenuItems(IContextMenuInvocation invocation) { |
| 37 | List<JMenuItem> menus = new ArrayList(); |
| 38 | JMenuItem Menu = new JMenuItem(PLUGIN_NAME); |
| 39 | |
| 40 | if(invocation.getInvocationContext() != IContextMenuInvocation.CONTEXT_MESSAGE_EDITOR_REQUEST){ |
| 41 | return menus; |
| 42 | } |
| 43 | |
| 44 | Menu.addActionListener(new ActionListener() { |
| 45 | public void actionPerformed(ActionEvent arg0) { |
| 46 | IHttpRequestResponse reqRsp = invocation.getSelectedMessages()[0]; |
| 47 | byte[] byteReq = reqRsp.getRequest(); |
| 48 | String strReq = new String(byteReq); |
| 49 | Windows.show(requestMapper.deal(strReq)); |
| 50 | } |
| 51 | }); |
| 52 | menus.add(Menu); |
| 53 | return menus; |
| 54 | } |
| 55 | } |
nothing calls this directly
no outgoing calls
no test coverage detected