def getUiComponent(self): self.spePanel = JPanel() self.spePanel.setBorder(None) self.spePanel.setLayout(None) self.logPane = JScrollPane() self.outputTxtArea = JTextArea() self.outputTxtArea.setFont(Font("Consolas", Font.PLAIN, 12)) self.outputTxtArea.setLineWrap(True) self.logPane.setViewportView(self.outputTxtArea) self.spePanel.add(self.logPane) self.clearBtn = JButton("Clear", actionPerformed=self.clearRst) self.exportBtn = JButton("Export", actionPerformed=self.exportRst) self.parentFrm = JFileChooser() self.spePanel.add(self.clearBtn) self.spePanel.add(self.exportBtn) self.logPane.setBounds(20, 50, 800, 600) self.clearBtn.setBounds(20, 650, 100, 30) self.exportBtn.setBounds(600, 650, 100, 30) self.sensitiveParamsRegularListPanel = JList(self.sensitiveParamR) self.sensitiveParamsRegularListPanel.setVisibleRowCount( len(self.sensitiveParamR)) #self.spePanel.add(self.sensitiveParamsRegularListPanel) #self.sensitiveParamsRegularListPanel.setBounds(850,50,150,600) self.sensitiveParamsRegularListScrollPanel = JScrollPane() self.sensitiveParamsRegularListScrollPanel.setViewportView( self.sensitiveParamsRegularListPanel) self.spePanel.add(self.sensitiveParamsRegularListScrollPanel) self.sensitiveParamsRegularListScrollPanel.setBounds(850, 50, 150, 600) self.addAndSaveNewParamRegularButton = JButton( 'add&&save', actionPerformed=self.addAndSaveNewParamRegular) self.spePanel.add(self.addAndSaveNewParamRegularButton) self.addAndSaveNewParamRegularButton.setBounds(1000, 50, 150, 30) self.addAndSaveNewParamRegularTextField = JTextField('NewParamRegular') self.spePanel.add(self.addAndSaveNewParamRegularTextField) self.addAndSaveNewParamRegularTextField.setBounds(1150, 50, 100, 30) self.alertSaveSuccess = JOptionPane() self.spePanel.add(self.alertSaveSuccess) self.delParamRegularButton = JButton( "delete", actionPerformed=self.delParamRegular) self.spePanel.add(self.delParamRegularButton) self.delParamRegularButton.setBounds(1000, 90, 100, 30) return self.spePanel
def word_corrections(event): words_string = "" for word in self.word_classifier.words: words_string = words_string + word.upper() + "\n" text = "The words that can be corrected are:\n\n" + words_string dialog = JOptionPane(text, JOptionPane.INFORMATION_MESSAGE) dialog_wrapper = JDialog(self, "Available Words", False) dialog_wrapper.setContentPane(dialog) dialog_wrapper.pack() dialog_wrapper.setVisible(True)
def editRegex(self, event): selectedRowIdx = self.regexTable.getSelectedRow() if selectedRowIdx == -1: return False selectedRow = self.regexTableModel.data[selectedRowIdx] optionPane = JOptionPane() dialog = optionPane.createDialog(self._splitpane, "Edit RegEx") panel = JPanel(GridLayout(0, 2)) panel.setBorder(EmptyBorder(10, 10, 10, 10)) nameField = JTextField('', 15) nameField.text = selectedRow[0] panel.add(JLabel("Name:", SwingConstants.LEFT)) panel.add(nameField) regexField = JTextField('', 15) regexField.text = selectedRow[1] panel.add(JLabel("RegEx:", SwingConstants.LEFT)) panel.add(regexField) crawlField = JCheckBox() crawlField.setSelected(selectedRow[2]) panel.add(JLabel("Crawl:", SwingConstants.LEFT)) panel.add(crawlField) def closeDialog(event): if len(nameField.text) == 0 or len(regexField.text) == 0: JOptionPane.showMessageDialog(self._splitpane, "Name or RegEx can't be empty", "Error", JOptionPane.ERROR_MESSAGE) return self.regexTableModel.editRow( selectedRowIdx, [nameField.text, regexField.text, crawlField.isSelected()]) dialog.hide() editButton = JButton('OK', actionPerformed=closeDialog) panel.add(editButton) dialog.setSize(600, 200) dialog.setContentPane(panel) self._callbacks.customizeUiComponent(dialog) dialog.show() return True
def _init_dialog(self, message): self._buttons = ['PASS', 'FAIL'] self._pane = JOptionPane(message, PLAIN_MESSAGE, YES_NO_OPTION, None, self._buttons, 'PASS')
def _init_dialog(self, message): self._pane = JOptionPane(message, PLAIN_MESSAGE, OK_CANCEL_OPTION) self._pane.setWantsInput(True) self._pane.setSelectionValues(self._options)
def _init_dialog(self, message): self._pane = JOptionPane(message, PLAIN_MESSAGE, DEFAULT_OPTION)
def __init__(self, message): pane = JOptionPane(message, PLAIN_MESSAGE, YES_NO_OPTION, None, ['PASS', 'FAIL'], 'PASS') _SwingDialog.__init__(self, pane)
def __init__(self, message, options): pane = JOptionPane(message, PLAIN_MESSAGE, OK_CANCEL_OPTION) pane.setWantsInput(True) pane.setSelectionValues(options) _SwingDialog.__init__(self, pane)
def __init__(self, message, default): pane = JOptionPane(message, PLAIN_MESSAGE, OK_CANCEL_OPTION) pane.setWantsInput(True) pane.setInitialSelectionValue(default) _SwingDialog.__init__(self, pane)
def __init__(self, message): pane = JOptionPane(message, PLAIN_MESSAGE, DEFAULT_OPTION) _SwingDialog.__init__(self, pane)
def initUI(self): self.tab = swing.JPanel() # UI for Output self.outputLabel = swing.JLabel("unauth api result:") self.outputLabel.setFont(Font("Tahoma", Font.BOLD, 14)) self.outputLabel.setForeground(Color(255, 102, 52)) self.logPane = swing.JScrollPane() self.outputTxtArea = swing.JTextArea() self.outputTxtArea.setFont(Font("Consolas", Font.PLAIN, 12)) self.outputTxtArea.setLineWrap(True) self.logPane.setViewportView(self.outputTxtArea) self.clearBtn = swing.JButton("Clear", actionPerformed=self.clearRst) self.exportBtn = swing.JButton("Export", actionPerformed=self.exportRst) self.parentFrm = swing.JFileChooser() self.showRspContentCheckBox = JCheckBox("show rspContent") self.showPostBodyCheckBox = JCheckBox("show post body") self.launchBurpUnauthCheckerCheckBox = JCheckBox( "launchBurpUnauthChecker") #self.includeAuthParamsLabel = swing.JLabel("includeAuthParams:") self.excludeAuthParamsLabel = swing.JLabel("excludeAuthParams:") self.filterSuffixLabel = swing.JLabel("filterSuffix:") self.removeAuthParamListText = self.authParamsList #print self.removeAuthParamListText self.removeAuthParamListTextField = JTextField(",".join( self.removeAuthParamListText)) self.excludeAuthParamsTextField = JTextField() self.filterSuffixTextField = JTextField(filterSuffixList) self.onlyIncludeStatusCodeTextField = JTextField("200") self.onlyIncludeStatusCodeLabel = JLabel("onlyIncludeStatusCode:") self.saveAuthParamsListButton = swing.JButton( "save", actionPerformed=self.addAndSaveAuthParam) self.alertSaveSuccess = JOptionPane() self.removeGetPostAuthParamsCheckBox = JCheckBox( "replace GET/POST Auth Params with ") self.replaceGetPostAuthParamsWithTextField = JTextField("unauthp") self.replaceHeaderValWithLabel = JLabel("replace header value with ") self.replaceHeaderValWithTextField = JTextField("unauthh") self.tab.setLayout(None) self.tab.add(self.launchBurpUnauthCheckerCheckBox) self.tab.add(self.showRspContentCheckBox) self.tab.add(self.showPostBodyCheckBox) self.tab.add(self.outputLabel) self.tab.add(self.logPane) self.tab.add(self.clearBtn) self.tab.add(self.exportBtn) self.tab.add(self.removeAuthParamListTextField) #self.tab.add(self.includeAuthParamsLabel) self.tab.add(self.excludeAuthParamsLabel) self.tab.add(self.filterSuffixLabel) self.tab.add(self.excludeAuthParamsTextField) self.tab.add(self.filterSuffixTextField) self.tab.add(self.onlyIncludeStatusCodeTextField) self.tab.add(self.onlyIncludeStatusCodeLabel) self.tab.add(self.saveAuthParamsListButton) self.tab.add(self.alertSaveSuccess) self.tab.add(self.removeGetPostAuthParamsCheckBox) self.tab.add(self.replaceGetPostAuthParamsWithTextField) self.tab.add(self.replaceHeaderValWithTextField) self.tab.add(self.replaceHeaderValWithLabel) self.launchBurpUnauthCheckerCheckBox.setBounds(20, 10, 200, 20) self.showRspContentCheckBox.setBounds(20, 40, 150, 30) self.showPostBodyCheckBox.setBounds(20, 75, 150, 30) self.outputLabel.setBounds(400, 200, 150, 50) self.logPane.setBounds(20, 250, 900, 400) self.clearBtn.setBounds(20, 650, 100, 30) self.exportBtn.setBounds(820, 650, 100, 30) self.removeAuthParamListTextField.setBounds(20, 140, 400, 30) #self.includeAuthParamsLabel.setBounds(20,100,100,20) self.excludeAuthParamsLabel.setBounds(580, 100, 150, 20) self.excludeAuthParamsTextField.setBounds(580, 120, 400, 30) self.filterSuffixLabel.setBounds(200, 40, 100, 20) self.filterSuffixTextField.setBounds(200, 60, 500, 30) self.onlyIncludeStatusCodeTextField.setBounds(750, 170, 120, 30) self.onlyIncludeStatusCodeLabel.setBounds(600, 170, 190, 20) self.saveAuthParamsListButton.setBounds(20, 180, 80, 30) self.removeGetPostAuthParamsCheckBox.setBounds(120, 170, 280, 20) self.replaceGetPostAuthParamsWithTextField.setBounds(380, 170, 70, 30) self.replaceHeaderValWithLabel.setBounds(20, 100, 180, 20) self.replaceHeaderValWithTextField.setBounds(190, 100, 70, 30)