diff --git a/PentestMapper.py b/PentestMapper.py index 84ff73a..33d915d 100644 --- a/PentestMapper.py +++ b/PentestMapper.py @@ -288,6 +288,13 @@ def registerExtenderCallbacks(self, callbacks): comboColumn = self.table3.getColumnModel().getColumn(2) comboColumn.setCellEditor(DefaultCellEditor(self.comboBox)) + + + popupMenu2 = JPopupMenu() + deletevulnerability = JMenuItem("Delete Vulnerability", actionPerformed=self.deletevuln) + popupMenu2.add(deletevulnerability) + self.table3.setComponentPopupMenu(popupMenu2) + # adding the table size, width, location and will add the scroller to the table @@ -349,6 +356,14 @@ def deleterow(self,event): #totalrow = self.logTable.getRowCount() #self.callbacks.printOutput(str(totalrow)) + + def deletevuln(self,e): + totalvulnrows = self.table3.getSelectedRows() + #self.callbacks.printOutput(str(totalvulnrows)) + for rows in totalvulnrows: + #self.callbacks.printOutput(str(rows)) + self.dataModel2.removeRow(rows) + # part of custom table model to get total number of row in the table, it will check the data in the list amd will return when called @@ -559,7 +574,8 @@ def importchecklist(self, e): if ret == JFileChooser.APPROVE_OPTION: fileLoad = chooseFile.getSelectedFile() self.filepath = fileLoad.getAbsolutePath() - + self.comboBox.removeAllItems() + self.comboBox.addItem(None) self.dataModel.setRowCount(0) with open(self.filepath, 'rb') as f: reader2 = csv.reader(f, delimiter=',')