本文整理汇总了Python中javax.swing.JMenuItem方法的典型用法代码示例。如果您正苦于以下问题:Python swing.JMenuItem方法的具体用法?Python swing.JMenuItem怎么用?Python swing.JMenuItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing
的用法示例。
在下文中一共展示了swing.JMenuItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createMenuItems
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def createMenuItems(self, invocation):
'''
Invoked by Burp when a right-click menu is created; adds Git Bridge's
options to the menu.
'''
context = invocation.getInvocationContext()
tool = invocation.getToolFlag()
if tool == self.callbacks.TOOL_REPEATER:
if context in [invocation.CONTEXT_MESSAGE_EDITOR_REQUEST, invocation.CONTEXT_MESSAGE_VIEWER_RESPONSE]:
item = JMenuItem("Send to Git Bridge")
item.addActionListener(self.RepeaterHandler(self.callbacks, invocation, self.log))
items = ArrayList()
items.add(item)
return items
elif tool == self.callbacks.TOOL_SCANNER:
if context in [invocation.CONTEXT_SCANNER_RESULTS]:
item = JMenuItem("Send to Git Bridge")
item.addActionListener(self.ScannerHandler(self.callbacks, invocation, self.log))
items = ArrayList()
items.add(item)
return items
else:
# TODO: add support for other tools
pass
示例2: createMenuItems
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def createMenuItems(self, context_menu):
self.context = context_menu
menu_list = ArrayList()
menu_list.add(JMenuItem("Send to js scraper", actionPerformed=self.pre_scan))
return menu_list
示例3: createMenuItems
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def createMenuItems(self, invocation):
if invocation.getInvocationContext() == invocation.CONTEXT_PROXY_HISTORY:
mymenu=[]
if self.isEnabled:
item=JMenuItem("Multi-Browser Highlight (Running): Click to Disable ")
else:
item=JMenuItem("Multi-Browser Highlight (Stopped): Click to Enable ")
item.addActionListener(self)
mymenu.append(item)
return mymenu
else:
return None
示例4: createMenuItems
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def createMenuItems(self, contextMenuInvocation):
self._contextMenuData = contextMenuInvocation.getSelectedMessages()
menu_list = ArrayList()
menu_list.add(JMenuItem("Send to BurpSmartBuster",actionPerformed=self.menuItemClicked))
return menu_list
示例5: createMenuItems
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def createMenuItems(self, invocation):
#get only selected message
self.messageInfo = invocation.getSelectedMessages()[0]
menuItemList = ArrayList()
menuItemList.add(JMenuItem("Send request to ZIP File Raider extender Repeater", actionPerformed = self.contextRepeaterClick))
menuItemList.add(JMenuItem("Send request to ZIP File Raider extender Scanner", actionPerformed = self.contextScannerClick))
return menuItemList
示例6: createMenuItems
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def createMenuItems(self, invocation):
context = invocation.getInvocationContext()
if context == invocation.CONTEXT_MESSAGE_EDITOR_REQUEST \
or context == invocation.CONTEXT_MESSAGE_VIEWER_REQUEST \
or context == invocation.CONTEXT_PROXY_HISTORY \
or context == invocation.CONTEXT_TARGET_SITE_MAP_TABLE \
or context == invocation.CONTEXT_SEARCH_RESULTS:
self.messages_to_send = invocation.getSelectedMessages()
if len(self.messages_to_send):
return [JMenuItem('Send to CPH', actionPerformed=self.send_to_cph)]
else:
return None
示例7: createMenuItems
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def createMenuItems(self, invocation):
menuItems = list()
selectedMsgs = invocation.getSelectedMessages()
if selectedMsgs != None and len(selectedMsgs) >= 1:
menuItems.append(JMenuItem("Add to ElasticSearch Index", actionPerformed=self.genAddToES(selectedMsgs, invocation.getInputEvent().getComponent())))
return menuItems
示例8: createMenuItems
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def createMenuItems(self, invocation):
menu = []
# Which part of the interface the user selects
ctx = invocation.getInvocationContext()
# Message Viewer Req will show menu item if selected by the user
if ctx == 0 or ctx == 2:
menu.append(swing.JMenuItem("SQLiPy Scan", None, actionPerformed=lambda x, inv=invocation: self.sqlMapScan(inv)))
return menu if menu else None
示例9: createMenuItems
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def createMenuItems(self, invocation):
messages = invocation.getSelectedMessages()
def addRequestsToTab(e):
for messageInfo in messages:
parameters = self._helpers.analyzeRequest(
messageInfo.getRequest()).getParameters()
# saveBuffers is required since modifying the original from its
# source changes the saved objects, its not a copy
messageIndex = self._db.createNewMessage(
self._callbacks.saveBuffersToTempFiles(messageInfo),
messageInfo.getHost(),
self._helpers.analyzeRequest(
messageInfo.getRequest()).getMethod(),
self._helpers.analyzeRequest(messageInfo).getUrl().getPath(),
parameters,
True)
# self._messageTable.getModel().addRow(row)
self._messageTable.redrawTable()
ret = []
menuItem = JMenuItem("Send request(s) to LightBulb")
menuItem.addActionListener(addRequestsToTab)
ret.append(menuItem)
return(ret)
##
# implement IMessageEditorController
# this allows our request/response viewers to obtain details about the messages being displayed
##
# TODO: Is this necessary? The request viewers may not require this since they aren't editable
##
示例10: generate_menu_items
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def generate_menu_items(self):
all_tests = 'All tests'
if all_tests not in self.useragents.keys():
_tmparray = list()
for v in self.useragents.values():
_tmparray.extend(v)
self.useragents[all_tests] = _tmparray
if self.custom_file_text not in self.useragents.keys():
self.useragents[self.custom_file_text] = []
for k in self.useragents.keys():
menuitem = JMenuItem(k, actionPerformed=self.menuItemClicked)
self.menuitems[menuitem] = k
示例11: createMenuItems
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def createMenuItems(self, context_menu):
self.context = context_menu
menu_list = ArrayList()
menu_list.add(JMenuItem("Add subdomains to scope via Bumpster", actionPerformed=self.dnsdumpster_menu))
return menu_list
示例12: createMenuItems
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def createMenuItems(self, invocation):
return [JMenuItem("Send to Burp WP Intruder",
actionPerformed=lambda x, inv=invocation: self.menu_send_to_intruder_on_click(inv))]
示例13: __init__
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def __init__(self, text="Open In Browser"):
self.menuitem = JMenuItem(text)
self.menuitem.setEnabled(False)
self.menuitem.addActionListener(self)
示例14: __init__
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def __init__(self, helpers=None, callbacks=None, text=''):
self._helpers = helpers
self._callbacks = callbacks
self.menuitem = JMenuItem(text)
self._burp_menuitem = JMenuItem("inql: %s" % text)
self.set_enabled(False)
self._callbacks.registerContextMenuFactory(self)
示例15: __init__
# 需要导入模块: from javax import swing [as 别名]
# 或者: from javax.swing import JMenuItem [as 别名]
def __init__(self, text, action=None):
self._action = action
self.menuitem = JMenuItem(text)
self.menuitem.setEnabled(True)
self.menuitem.addActionListener(self)