Python javax.swing.JList() Examples

The following are 2 code examples of javax.swing.JList(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module javax.swing , or try the search function .
Example #1
Source File: typedef_tab.py    From blackboxprotobuf with MIT License 5 votes vote down vote up
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) 
Example #2
Source File: HeadersAnalyzer.py    From HeadersAnalyzer with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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)