Exemple #1
0
    def MenuBar(self):

        #-----------------------------------------------------------------------
        # Start by creating our application menubar
        #-----------------------------------------------------------------------
        menu = JMenuBar()

        #-----------------------------------------------------------------------
        # "Show" entry
        #-----------------------------------------------------------------------
        show = JMenu('Show')

        show.add(JMenuItem('Highlight text', actionPerformed=self.hilightText))

        show.add(JSeparator())
        show.add(JMenuItem('Exit', actionPerformed=self.Exit))
        menu.add(show)

        #-----------------------------------------------------------------------
        # "Help" entry
        #-----------------------------------------------------------------------
        help = JMenu('Help')
        help.add(JMenuItem('About', actionPerformed=self.about))
        help.add(JMenuItem('Notice', actionPerformed=self.notice))
        menu.add(help)

        return menu
Exemple #2
0
    def createMenuBar(self):
        menuBar = JMenuBar()

        fileMenu = JMenu('File')

        data = [['Spam', self.spam], ['Eggs', self.eggs],
                ['Bacon', self.bacon]]

        bGroup = ButtonGroup()
        for name, handler in data:
            rb = JRadioButtonMenuItem(name,
                                      actionPerformed=handler,
                                      selected=(name == 'Spam'))
            bGroup.add(rb)
            fileMenu.add(rb)

        exitItem = fileMenu.add(JMenuItem('Exit', actionPerformed=self.exit))
        menuBar.add(fileMenu)

        helpMenu = JMenu('Help')
        aboutItem = helpMenu.add(JMenuItem('About',
                                           actionPerformed=self.about))
        menuBar.add(helpMenu)

        return menuBar
 def createMenuItems(self, invocation):
     if invocation.getInvocationContext(
     ) == invocation.CONTEXT_PROXY_HISTORY:
         if self.enabled:
             mymenu = JMenu("Multi-Browser Highlight (Running)")
             mymenu.add(
                 JMenuItem("Click to disable",
                           None,
                           actionPerformed=lambda x: self.flip('enabled')))
             mymenu.add(
                 JMenuItem(
                     "Base of HTTP headers: " +
                     ("Enabled" if self.header_enabled else "Disabled"),
                     None,
                     actionPerformed=lambda x: self.flip('header_enabled')))
             mymenu.add(
                 JMenuItem(
                     "Base of User-Agent: " +
                     ("Enabled" if self.useragent_enabled else "Disabled"),
                     None,
                     actionPerformed=lambda x: self.flip('useragent_enabled'
                                                         )))
         else:
             mymenu = JMenu("Multi-Browser Highlight (Stopped)")
             mymenu.add(
                 JMenuItem("Click to enable",
                           None,
                           actionPerformed=lambda x: self.flip('enabled')))
         return [mymenu]
     else:
         return None
    def MenuBar( self ) :
        #-----------------------------------------------------------------------
        # Start by creating our application menubar
        #-----------------------------------------------------------------------
        menu = JMenuBar()

        #-----------------------------------------------------------------------
        # "File" entry
        #-----------------------------------------------------------------------
        jmFile   = JMenu( 'File' )
        jmiExit  = JMenuItem(
            'Exit',
            actionPerformed = self.Exit
        )
        jmFile.add( jmiExit )
        menu.add( jmFile )

        #-----------------------------------------------------------------------
        # "Help" entry
        #-----------------------------------------------------------------------
        jmHelp   = JMenu( 'Help' )
        jmiAbout = JMenuItem(
            'About',
            actionPerformed = self.about
        )
        jmiNote  = JMenuItem(
            'Notice',
            actionPerformed = self.notice
        )
        jmHelp.add( jmiAbout )
        jmHelp.add( jmiNote  )
        menu.add( jmHelp )

        return menu
Exemple #5
0
    def createMenuBar(self):
        menuBar = JMenuBar()

        fileMenu = JMenu('File')
        exitItem = fileMenu.add(JMenuItem('Exit', actionPerformed=self.exit))
        menuBar.add(fileMenu)

        codeMenu = JMenu('Encoding')

        data = ['ANSI', 'UTF-8', 'UCS-2 Big Endian', 'UCS-2 Little Endian']

        bGroup = ButtonGroup()
        for suffix in data:
            name = 'Encoding in ' + suffix
            rb = JRadioButtonMenuItem(name, selected=(suffix == 'ANSI'))
            bGroup.add(rb)
            codeMenu.add(rb)
        menuBar.add(codeMenu)

        viewMenu = JMenu('View')
        viewMenu.add(JCheckBoxMenuItem('Full screen'))
        viewMenu.add(JSeparator())  # Using JSeparator()
        #       viewMenu.addSeparator()        # Using addSeparator()
        #       viewMenu.insertSeparator( 1 )  #
        viewMenu.add(JCheckBoxMenuItem('Word wrap'))
        menuBar.add(viewMenu)

        return menuBar
Exemple #6
0
    def handleMouseEvent(self, event):
        if event.isPopupTrigger():
            loadMenu = JMenuItem("Load .proto")
            loadMenu.addActionListener(self.tab.listener)

            popup = JPopupMenu()
            popup.add(loadMenu)

            if self.tab.descriptors:

                deserializeAsMenu = JMenu("Deserialize As...")

                popup.addSeparator()
                popup.add(deserializeAsMenu)

                for pb2, descriptors in self.tab.descriptors.iteritems():
                    subMenu = JMenu(pb2)
                    deserializeAsMenu.add(subMenu)

                    for name, descriptor in descriptors.iteritems():
                        protoMenu = JMenuItem(name)
                        protoMenu.addActionListener(
                            DeserializeProtoActionListener(self.tab, descriptor))

                        subMenu.add(protoMenu)

            popup.show(event.getComponent(), event.getX(), event.getY())

        return
Exemple #7
0
    def menuBar( self ) :
        menu = JMenuBar()

        #-----------------------------------------------------------------------
        # "File" entry
        #-----------------------------------------------------------------------
        jmFile   = JMenu( 'File' )
        jmiExit  = JMenuItem(
            'Exit',
            actionPerformed = self.Exit
        )
        jmFile.add( jmiExit )
        menu.add( jmFile )

        #-----------------------------------------------------------------------
        # "Help" entry
        #-----------------------------------------------------------------------
        jmHelp   = JMenu( 'Help' )
        jmiAbout = JMenuItem(
            'About',
            actionPerformed = self.about
        )
        jmiNote  = JMenuItem(
            'Notice',
            actionPerformed = self.notice
        )
        jmHelp.add( jmiAbout )
        jmHelp.add( jmiNote  )
        menu.add( jmHelp )

        return menu
Exemple #8
0
    def MenuBar(self):

        #-----------------------------------------------------------------------
        # Start by creating our application menubar
        #-----------------------------------------------------------------------
        menu = JMenuBar()

        #-----------------------------------------------------------------------
        # Build the "File" -> "Changes" (nested) menu
        #-----------------------------------------------------------------------
        self.ChangesMI = JMenu('Changes', enabled=0)
        self.ChangesMI.add(JMenuItem('Save', actionPerformed=self.save))
        self.ChangesMI.add(JMenuItem('Discard', actionPerformed=self.discard))

        #-----------------------------------------------------------------------
        # "File" entry
        #-----------------------------------------------------------------------
        jmFile = JMenu('File')
        jmFile.add(self.ChangesMI)
        jmFile.add(JMenuItem('Exit', actionPerformed=self.Exit))
        menu.add(jmFile)

        #-----------------------------------------------------------------------
        # "Help" entry
        #-----------------------------------------------------------------------
        jmHelp = JMenu('Help')
        jmHelp.add(JMenuItem('About', actionPerformed=self.about))
        jmHelp.add(JMenuItem('Notice', actionPerformed=self.notice))
        menu.add(jmHelp)

        return menu
Exemple #9
0
    def createMenuBar(self):
        menuBar = JMenuBar()

        fileMenu = JMenu('File')

        data = [['Spam', self.spam], ['Eggs', self.eggs],
                ['Bacon', self.bacon]]

        bGroup = ButtonGroup()
        for name, handler in data:
            rb = JRadioButtonMenuItem(name,
                                      actionPerformed=handler,
                                      selected=(name == 'Spam'))
            bGroup.add(rb)
            fileMenu.add(rb)

        fileMenu.add(JSeparator())  # Using JSeparator()
        for name, handler in data:
            fileMenu.add(JCheckBoxMenuItem(name, actionPerformed=handler))

        fileMenu.addSeparator()  # Using addSeparator()
        exitItem = fileMenu.add(
            JMenuItem('Exit',
                      KeyEvent.VK_X,
                      actionPerformed=self.exit,
                      accelerator=KeyStroke.getKeyStroke(
                          'x', InputEvent.ALT_DOWN_MASK)))
        menuBar.add(fileMenu)

        helpMenu = JMenu('Help')
        aboutItem = helpMenu.add(
            JMenuItem('About', KeyEvent.VK_A, actionPerformed=self.about))
        menuBar.add(helpMenu)

        return menuBar
Exemple #10
0
    def MenuBar(self):

        #-----------------------------------------------------------------------
        # Start by creating our application menubar
        #-----------------------------------------------------------------------
        menu = JMenuBar()

        #-----------------------------------------------------------------------
        # "Show" entry
        #-----------------------------------------------------------------------
        show = JMenu('Show')

        show.add(JMenuItem('Collapse all', actionPerformed=self.collapse))
        show.add(JMenuItem('Expand all', actionPerformed=self.expand))

        show.add(JSeparator())
        show.add(JMenuItem('Find...', actionPerformed=self.Find))

        show.add(JSeparator())
        show.add(JMenuItem('Exit', actionPerformed=self.Exit))
        menu.add(show)

        #-----------------------------------------------------------------------
        # "Help" entry
        #-----------------------------------------------------------------------
        help = JMenu('Help')
        help.add(JMenuItem('About', actionPerformed=self.about))
        help.add(JMenuItem('Notice', actionPerformed=self.notice))
        menu.add(help)

        return menu
Exemple #11
0
    def __init__(self, app, menuTitle):
        JMenu.__init__(self, menuTitle)
        self.app = app
        #quat dialog item
        dialogItem = JCheckBoxMenuItem(self.app.dlg.toggleAction)
        self.add(dialogItem)
        self.addSeparator()

        #tool submenu
        for tool in self.app.tools:
            if tool.name == "favourites":
                self.addSeparator()
            toolMenu = JMenu(tool.title)
            toolMenu.setIcon(tool.bigIcon)
            if tool.uri != "":
                #Website link
                iconFile = File.separator.join(
                    [self.app.SCRIPTDIR, "images", "icons", "browser.png"])
                urlItem = JMenuItem(tool.title)
                urlItem.setIcon(ImageIcon(iconFile))
                urlItem.addActionListener(
                    QatMenuActionListener(self.app, "link", tool))
                toolMenu.add(urlItem)
                toolMenu.addSeparator()
            #View submenu
            for view in tool.views:
                viewMenu = JMenu(view.title)
                if tool.name == "favourites":
                    self.app.favouritesMenu = viewMenu
                #Check item
                for check in view.checks:
                    self.add_check_item(tool, view, check, viewMenu)
                toolMenu.add(viewMenu)
            self.add(toolMenu)
        #Local file with errors
        localFileItem = JMenuItem(self.app.strings.getString("Open_GPX"))
        localFileItem.setIcon(ImageProvider.get("open"))
        localFileItem.addActionListener(
            QatMenuActionListener(self.app, "local file"))
        self.add(localFileItem)
        self.addSeparator()
        #False positive dialog
        falsepositiveItem = JMenuItem(
            self.app.strings.getString("False_positives..."))
        falsepositiveItem.addActionListener(
            QatMenuActionListener(self.app, "dialog"))
        self.add(falsepositiveItem)
        #Preferences dialog
        preferencesItem = JMenuItem(
            self.app.strings.getString("Preferences..."))
        preferencesItem.addActionListener(
            QatMenuActionListener(self.app, "dialog"))
        self.add(preferencesItem)
        #About dialog item
        aboutItem = JMenuItem(self.app.strings.getString("About..."))
        aboutItem.addActionListener(QatMenuActionListener(self.app, "dialog"))
        self.add(aboutItem)
Exemple #12
0
def studentLogined(stObj):
    global panel
    global table
    global heading
    global frame

    frame = JFrame("Student  Page ")
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE)
    frame.setSize(500, 600)
    frame.setLocation(200, 200)
    frame.setLayout(None)

    panel = JPanel()
    panel.setSize(500, 580)
    panel.setLocation(0, 20)
    panel.setLayout(None)
    panel.setVisible(True)
    panel.setBackground(Color.WHITE)

    heading = JLabel()
    heading.setBounds(210, 10, 200, 30)

    table = JTable()
    table.setBounds(0, 50, 500, 470)
    sp = JScrollPane(table, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
                     ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS)

    bar = JMenuBar()

    profile = JMenu("Profile")
    showProfile = JMenuItem("Show Profile",
                            actionPerformed=clickShowStudentProfile)
    changePassword = JMenuItem("Change Password",
                               actionPerformed=changeStudentPassword)
    profile.add(showProfile)
    profile.add(changePassword)
    bar.add(profile)

    attendence = JMenu("Attendence")
    showAllAttendence = JMenuItem("Show All Attendence",
                                  actionPerformed=clickAllAttendence)
    showAttendenceInMonth = JMenuItem("show attendence in month",
                                      actionPerformed=clickAttendenceInMonth)
    attendence.add(showAllAttendence)
    attendence.add(showAttendenceInMonth)
    bar.add(attendence)

    logout = JMenuItem("logout", actionPerformed=clickLogout)
    bar.add(logout)

    panel.add(table)

    frame.setJMenuBar(bar)
    frame.add(panel)

    frame.setVisible(True)
Exemple #13
0
def tcMenu():
    caseSubMenu = JMenu("case view")
    for pkg in (entity == 'package'):
        pkgSubMenu = JMenu(pkg.name)
        cases = [ x.getNode2() for x in (pkg->(entity == 'testcase'))]
        for case in cases:
            caseItem = JMenuItem(case.name)
            caseItem.actionPerformed = lambda event : viewCase(event.getActionCommand())
            pkgSubMenu.add(caseItem)
        caseSubMenu.add(pkgSubMenu)
    return caseSubMenu
    def createMenuItems(self, invoker):

        self.invoker = invoker

        self.selection = self.invoker.getSelectionBounds()

        context = self.invoker.getInvocationContext()
        if not (context == self.invoker.CONTEXT_MESSAGE_EDITOR_REQUEST
                or context == self.invoker.CONTEXT_MESSAGE_VIEWER_REQUEST
                or context == self.invoker.CONTEXT_MESSAGE_EDITOR_RESPONSE
                or context == self.invoker.CONTEXT_MESSAGE_VIEWER_RESPONSE):
            return None

        menu_translate_sel = JMenuItem(self.src_menu_text,
                                       actionPerformed=self.translate)
        menu_translate_sel.setEnabled(False)
        menu_translate_clip = JMenuItem(self.dst_menu_text,
                                        actionPerformed=self.translate)
        menu_translate_clip.setEnabled(False)

        if self.selection is not None and self.selection[0] != self.selection[
                1]:
            menu_translate_sel.setEnabled(True)
        if self.get_clipboard_text() is not None:
            menu_translate_clip.setEnabled(True)

        menu_header = JMenu(
            '%s v%s' %
            (BurpExtender.extension_name, BurpExtender.extension_version))
        menu_src = JMenu('Source Language [%s]' % (self.src))
        menu_dst = JMenu('Destination Language [%s]' % (self.dst))
        menu_automatic = JCheckBoxMenuItem('Automatic',
                                           actionPerformed=self.select_src)
        menu_src.add(menu_automatic)
        if self.src == menu_automatic.getText():
            menu_automatic.setSelected(True)
        for lang in sorted(langs):
            menu_item = JCheckBoxMenuItem(lang,
                                          actionPerformed=self.select_src)
            if lang == self.src:
                menu_item.setSelected(True)
            menu_src.add(menu_item)
            menu_item = JCheckBoxMenuItem(lang,
                                          actionPerformed=self.select_dst)
            if lang == self.dst:
                menu_item.setSelected(True)
            menu_dst.add(menu_item)

        menu_header.add(menu_src)
        menu_header.add(menu_dst)
        menu_header.add(menu_translate_sel)
        menu_header.add(menu_translate_clip)

        return [menu_header]
    def createMenuItems(self, invocation):
        menu = JMenu(self._actionName)

        # create import file menu.
        import_menu = JMenu("import file")
        as_json_menu_item = JMenuItem("as JSON")
        as_json_menu_item.actionPerformed = self.generateSelectFileAction(
            invocation, as_json_menu_item)

        import_menu.add(as_json_menu_item)
        menu.add(import_menu)
        menu.addSeparator()

        # load snippets json file.
        snippets_data = None
        try:
            with open(self.snippets_file_path, "r") as f:
                snippets_data = json.load(f)
        except Exception as e:
            print("Load JSON Error!")
            print(e)

        # create payload menu.

        # # if snippets_data is not set.
        if snippets_data is None:
            return [menu]

        try:
            for i in snippets_data:
                type_menu = JMenu(i["type"])
                for j in i["items"]:
                    key = j["key"]
                    payload = j["value"]

                    a = JMenuItem(
                        key,
                        None,
                        actionPerformed=self.generateClickAction(
                            invocation, payload),
                    )
                    type_menu.add(a)
                menu.add(type_menu)

        except Exception as e:
            print("Convert snippets Error!")
            print(e)

        return [menu]
Exemple #16
0
    def run(self):
        frame = JFrame('Menu2',
                       size=(200, 125),
                       defaultCloseOperation=JFrame.EXIT_ON_CLOSE)
        menuBar = JMenuBar(background=Color.blue, foreground=Color.white)
        fileMenu = JMenu('File')
        fileMenu.add(JMenuItem('Exit'))
        menuBar.add(fileMenu)

        helpMenu = JMenu('Help')
        helpMenu.add(JMenuItem('About'))
        menuBar.add(helpMenu)

        frame.setJMenuBar(menuBar)
        frame.setVisible(1)
 def menuBar(self):
     result = JMenuBar()
     newMenu = result.add(JMenu('New'))
     newMenu.add(JMenuItem('InnerFrame', actionPerformed=self.addIframe))
     newMenu.addSeparator()
     newMenu.add(JMenuItem('Exit', actionPerformed=self.exit))
     return result
Exemple #18
0
    def run(self):
        frame = JFrame('Table11',
                       size=(300, 170),
                       locationRelativeTo=None,
                       defaultCloseOperation=JFrame.EXIT_ON_CLOSE)

        menuBar = JMenuBar()
        resize = JMenu('AUTO_RESIZE')

        bGroup = ButtonGroup()
        for name, value in self.info:
            rb = JRadioButtonMenuItem(name,
                                      actionPerformed=self.handler,
                                      selected=(name == 'Rest'))
            bGroup.add(rb)
            resize.add(rb)
        menuBar.add(resize)
        frame.setJMenuBar(menuBar)

        headings = 'T/F,Date,Integer,Float,Double'.split(',')
        model = myTM(self.data, headings)
        self.table = table = JTable(
            model, selectionMode=ListSelectionModel.SINGLE_SELECTION)
        table.getColumnModel().getColumn(model.getColumnCount() -
                                         1  # i.e., last column
                                         ).setCellRenderer(myRenderer())
        setColumnWidths(table)

        frame.add(JScrollPane(table))
        frame.setVisible(1)
Exemple #19
0
    def createMenuItems(self, invocation):
        self.menus = []
        self.mainMenu = JMenu("fakeIp")
        self.menus.append(self.mainMenu)
        self.invocation = invocation
        # print invocation.getSelectedMessages()[0].getRequest()
        menuItem = ['inputIP', '127.0.0.1', 'randomIP', '0x2130706433']
        for tool in menuItem:
            # self.mainMenu.add(JMenuItem(tool))
            if tool == 'inputIP':
                menu = JMenuItem(
                    tool, None, actionPerformed=lambda x: self.modifyHeader(x))
                self.mainMenu.add(menu)
            elif tool == '127.0.0.1':
                menu = JMenuItem(
                    tool, None, actionPerformed=lambda x: self.modifyHeader(x))
                self.mainMenu.add(menu)
            elif tool == 'randomIP':
                menu = JMenuItem(
                    tool, None, actionPerformed=lambda x: self.modifyHeader(x))
                self.mainMenu.add(menu)
            elif tool == '0x2130706433':
                menu = JMenuItem(
                    tool, None, actionPerformed=lambda x: self.modifyHeader(x))
                self.mainMenu.add(menu)

        return self.menus if self.menus else None
Exemple #20
0
    def init(self):
        w, h, aa, threads = (512, 512, 1, 2)
        canvas = RayTracePanel(w, h, aa, threads)
        self.getContentPane().add(JScrollPane(canvas))

        #Save FileChooser
        #fcS = JFileChooser()
        #fcS.addChoosableFileFilter(FileNameExtensionFilter('Windows Bitmap (*.bmp)', ['bmp']))
        #fcS.addChoosableFileFilter(FileNameExtensionFilter('JPEG / JFIF (*.jpg)', ['jpg']))
        #fcS.addChoosableFileFilter(FileNameExtensionFilter('Portable Network Graphics (*.png)', ['png']))
        #def saveFile(event):
        #    '''Performed when the save button is pressed'''
        #    result = fcS.showSaveDialog(frame)
        #    if result == JFileChooser.APPROVE_OPTION:
        #        file = fcS.getSelectedFile()
        #        fname = file.getPath()
        #        ext = fcS.getFileFilter().getExtensions()[0]
        #        if not fname.endswith('.' + ext):
        #            file = File(fname + '.' + ext)
        #        canvas.saveToFile(file, ext)

        #Open FileChooser
        #fcO = JFileChooser()
        #fcO.addChoosableFileFilter(FileNameExtensionFilter('RayTrace Scene File (*.rts)', ['rts']))
        #def openFile(event):
        #    '''Performed when the open button is pressed'''
        #    result = fcO.showOpenDialog(frame)
        #    if result == JFileChooser.APPROVE_OPTION:
        #        fname = fcO.getSelectedFile().getPath()
        #        if fname.endswith('.rts'):
        #            f = open(fname, 'rb')
        #            newScene = SceneFactory().buildScene(f)
        #            f.close()
        #            Painter(canvas, newScene, openButton, saveButton, stopButton).start()

        def stop(event):
            '''Peformed when the stop button is pressed'''
            canvas.stopRendering()

        #Setup Menu
        menuBar = JMenuBar()
        menu = JMenu("File")
        menuBar.add(menu)
        #openButton = JMenuItem("Open...", actionPerformed=openFile)
        #openButton.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK))
        #menu.add(openButton)
        #saveButton = JMenuItem("Save as...", actionPerformed=saveFile)
        #saveButton.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK))
        #menu.add(saveButton)
        menu.addSeparator()
        stopButton = JMenuItem('Stop Render', actionPerformed=stop)
        stopButton.setAccelerator(KeyStroke.getKeyStroke(
            KeyEvent.VK_ESCAPE, 0))
        stopButton.setEnabled(False)
        menu.add(stopButton)
        menu.addSeparator()
        #closeButton = JMenuItem('Close', actionPerformed=exit)
        #closeButton.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, ActionEvent.ALT_MASK))
        #menu.add(closeButton)
        self.setJMenuBar(menuBar)
Exemple #21
0
    def menu(self):
        f = JMenu("File")

        o = JMenuItem("Copy")
        o.addActionListener(ActionEventListener(self.opencopy))
        self.open = o
        f.add(o)

        o = JMenuItem("New")
        o.addActionListener(ActionEventListener(self.new))
        self.open = o
        f.add(o)

        o = JMenuItem("Open")
        o.addActionListener(ActionEventListener(self.opendialog))
        self.open = o
        f.add(o)

        o = JMenuItem("Save")
        o.addActionListener(ActionEventListener(self.save))
        self.open = o
        f.add(o)

        o = JMenuItem("Save As")
        o.addActionListener(ActionEventListener(self.saveas))
        self.open = o
        f.add(o)

        return f
    def createMenuItems(self, invocation):
        self.context = invocation

        subMenu = JMenu("Copy Things")
        subMenu.add(JMenuItem("Copy host only",
                              actionPerformed=self.copy_host))
        subMenu.add(JMenuItem("Copy path only",
                              actionPerformed=self.copy_path))
        subMenu.add(
            JMenuItem("Copy URL without parameters",
                      actionPerformed=self.copy_url))
        subMenu.add(
            JMenuItem("Copy query parameters",
                      actionPerformed=self.copy_parameters))
        subMenu.add(
            JMenuItem("Copy body parameters",
                      actionPerformed=self.copy_parameters))
        subMenu.add(
            JMenuItem("Copy cookies", actionPerformed=self.copy_parameters))
        subMenu.add(
            JMenuItem("Copy headers", actionPerformed=self.copy_headers))

        menu_list = ArrayList()
        menu_list.add(subMenu)
        return menu_list
Exemple #23
0
    def createMenuItems(self, invocation):
        self._context = invocation
        menuList = ArrayList()

        parentMenu = JMenu('CorsPoc')

        menuItemWildCard = JMenuItem("WildCard",
                                     actionPerformed=self.asWildCard)
        menuItemBasicPoc = JMenuItem("BasicPoc",
                                     actionPerformed=self.asBasicPoc)
        menuItemnullOrigin = JMenuItem("nullOrigin",
                                       actionPerformed=self.asnullOrigin)

        parentMenu.add(menuItemWildCard)
        parentMenu.add(menuItemBasicPoc)
        parentMenu.add(menuItemnullOrigin)
        menuList.add(parentMenu)

        # Request info
        iRequestInfo = self._helpers.analyzeRequest(
            self._context.getSelectedMessages()[0])
        self.url = iRequestInfo.getUrl().toString()
        self.payload = ''.join(
            map(chr,
                self._context.getSelectedMessages()[0].getRequest())).split(
                    '\r\n\r\n')[1]

        return menuList
Exemple #24
0
def initMenu():
    global glzz
    tmenu = JMenu("testQ")

    smellv = JMenuItem("smell view")
    smellv.actionPerformed = lambda event : SmellView(glzz).go()
    tmenu.add(smellv)

    radialv = JMenuItem("radial suite view")
    radialv.actionPerformed = lambda event : RadialSuiteView(glzz).go()
    tmenu.add(radialv)

    treesv = JMenuItem("tree suite view")
#    treesv.actionPerformed = lambda event : displayTreeSuiteView(glzz)
    treesv.actionPerformed = lambda event : TreeSuiteView(glzz).go()
    tmenu.add(treesv)

    tmenu.add(tcMenu())

    smellp = JMenuItem("smell pie")
    smellp.actionPerformed = lambda event : plotSmellFrequency()
    tmenu.add(smellp)

    gbar = Guess.getMainUIWindow().getGMenuBar()
    gbar.add(tmenu)
    gbar.getMenu(3).removeAll() # deface the layout menu
    gbar.revalidate()
    gbar.repaint()
Exemple #25
0
 def createMenuItems(self, contextMenuInvocation):
     menuItemList = ArrayList()
     self._contextMenuData = contextMenuInvocation.getSelectedMessages()
     submenu = JMenu(EXTENSION_NAME)
     for menuitem in sorted(self.menuitems):
         submenu.add(menuitem)
     menuItemList.add(submenu)
     return menuItemList
Exemple #26
0
 def loadMenus(self):
     self.menus = []
     self.mainMenu = JMenu("TPLogScan")
     self.menus.append(self.mainMenu)
     menu = JMenuItem('ThinkPHP v3', None, actionPerformed=lambda x: self.eventHandler(x))
     self.mainMenu.add(menu)
     menu = JMenuItem('ThinkPHP v5', None, actionPerformed=lambda x: self.eventHandler(x))
     self.mainMenu.add(menu)
Exemple #27
0
 def createMenuItems(self, invocation):
     menu = JMenu(self._actionName)
     self._menu_item = JMenuItem(
         "Export",
         None,
         actionPerformed=lambda x, inv=invocation: self.Action(inv),
     )
     menu.add(self._menu_item)
     return [menu]
 def _prepare_menu(self, labels, parent):
     for label in sorted(labels.keys()):
         if labels[label]:
             menu_item = JMenu(label)
             self._prepare_menu(labels[label], menu_item)
         else:
             menu_item = JMenuItem(label)
             menu_item.addActionListener(self)
         parent.add(menu_item)
Exemple #29
0
    def run(self):
        frame = JFrame('Menu3',
                       size=(200, 125),
                       defaultCloseOperation=JFrame.EXIT_ON_CLOSE)
        menuBar = JMenuBar(background=Color.blue)
        #       print '\nmenuBar size before:', menuBar.getPreferredSize()

        fileMenu = JMenu('File', foreground=Color.white)
        fileMenu.add(JMenuItem('Exit'))
        menuBar.add(fileMenu)
        #       print 'menuBar size  after:', menuBar.getPreferredSize()

        helpMenu = JMenu('Help', foreground=Color.white)
        helpMenu.add(JMenuItem('About'))
        menuBar.add(helpMenu)

        frame.setJMenuBar(menuBar)
        frame.setVisible(1)
Exemple #30
0
    def createMenuItems(self, invocation):
        # Do not create a menu item unless getting a context menu from the proxy history or scanner results
        is_intruder_results = invocation.getInvocationContext(
        ) == invocation.CONTEXT_INTRUDER_ATTACK_RESULTS
        is_proxy_history = invocation.getInvocationContext(
        ) == invocation.CONTEXT_PROXY_HISTORY
        is_scanner_results = invocation.getInvocationContext(
        ) == invocation.CONTEXT_SCANNER_RESULTS
        is_target_tree = invocation.getInvocationContext(
        ) == invocation.CONTEXT_TARGET_SITE_MAP_TREE
        is_correct_context = is_proxy_history or is_scanner_results or is_target_tree or is_intruder_results

        if not is_correct_context:
            return

        request_response = invocation.getSelectedMessages()[0]

        functionality = self.view.get_checklist()["Functionality"]

        # Create the menu item for the Burp context menu
        bugcatcher_menu = JMenu("Send to HUNT - Methodology")

        # TODO: Sort the functionality by name and by vuln class
        for functionality_name in functionality:
            tests = functionality[functionality_name]["tests"]
            menu_test = JMenu(functionality_name)

            # Create a menu item and an action listener per vulnerability
            # class on each functionality
            for test_name in tests:
                item_test = JMenuItem(test_name)
                menu_action_listener = MenuActionListener(
                    self.view, self.callbacks, request_response,
                    functionality_name, test_name)
                item_test.addActionListener(menu_action_listener)
                menu_test.add(item_test)

            bugcatcher_menu.add(menu_test)

        burp_menu = []
        burp_menu.append(bugcatcher_menu)

        return burp_menu