Python源码示例:javax.swing.JList()

示例1
def __init__(self, burp_callbacks):
        self._burp_callbacks = burp_callbacks

        self._type_list_component = JList(blackboxprotobuf.known_messages.keys())
        self._type_list_component.setSelectionMode(ListSelectionModel.SINGLE_SELECTION)

        self._component = JSplitPane(JSplitPane.HORIZONTAL_SPLIT)
        self._component.setLeftComponent(JScrollPane(self._type_list_component))
        self._component.setRightComponent(self.createButtonPane())
        self._component.setResizeWeight(0.9) 
示例2
def findInteresting(self, host, headers):
        list_boring_headers = []
        model = self.boringHeadersList.getModel()
   
        # Get list of boring headers from the GUI JList
        for i in range(0, model.getSize()):
            list_boring_headers.append(model.getElementAt(i))
        
        issuename = "Interesting Header(s)"
        issuelevel = "Low"
        issuedetail = "<p>The response includes the following potentially interesting headers:</p><ul>"
        log = "[+] Interesting Headers found: " + host + "\n"
        found = 0

        for header in headers:
            if header.lower() not in list_boring_headers:
                issuedetail += "<li>Header name: <b>" + header + "</b>. Header value: <b>" + headers[header] + "</b></li>"

                log += "    Header name:" + header + " Header value:" + headers[header] + "\n"
                
                host = self._requestResponse.getHttpService().getHost()
                report = header + ":" + headers[header]
                if report not in self.global_issues[host]["Interesting"]:   # If header not already in the list we store it
                    self.global_issues[host]["Interesting"].append(report)

                found += 1
        
        issuedetail += "</ul>"

        if found > 0:
            # Create a ScanIssue object and append it to our list of issues, marking the reflected parameter value in the response.
            self.scan_issues.append(ScanIssue(self._requestResponse.getHttpService(),
	            self._helpers.analyzeRequest(self._requestResponse).getUrl(), 
                issuename, issuelevel, issuedetail))

            self.logsTA.append(log)