def EzMenuBar(menubar_table): from javafx.scene.control import MenuBar menubar = MenuBar() for m in menubar_table: if m.get('name'): menubar.getMenus().add(EzMenu(m['name'],m['item'])) else: if m.get('fontsize'): menubar.setStyle("-fx-font: " + m['fontsize'] + " arial;") return menubar
def initializeMenuElements(self): """Initialize the menu that is shown in the Burp Suite tab.""" from javafx.scene.control import Menu from javafx.scene.control import MenuBar from javafx.scene.control import MenuItem menuItems = {} # File menuFile = Menu("File") menuItems["ExportSimilar"] = MenuItem("Export similar URLs to file") menuItems["ExportUnique"] = MenuItem("Export unique URLs to file") menuFile.getItems().add(menuItems["ExportSimilar"]) menuFile.getItems().add(menuItems["ExportUnique"]) # Scope menuScope = Menu("Scope") menuItems["MarkOutOfScope"] = MenuItem( "Mark similar requests as 'out of scope'") menuScope.getItems().add(menuItems["MarkOutOfScope"]) # Graph menuGraph = Menu("Graph") menuItems["Reset"] = MenuItem("Reset") menuGraph.getItems().add(menuItems["Reset"]) # Help menuHelp = Menu("Help") menuItems["Support"] = MenuItem("Support") menuItems["About"] = MenuItem("About") menuHelp.getItems().add(menuItems["Support"]) menuHelp.getItems().add(menuItems["About"]) menuBar = MenuBar() menuBar.getMenus().add(menuFile) menuBar.getMenus().add(menuScope) menuBar.getMenus().add(menuGraph) menuBar.getMenus().add(menuHelp) self.elements["right"].getChildren().add(0, menuBar) for (key, menuItem) in menuItems.items(): menuItem.setOnAction(getattr(self, "on" + key + "Click"))