1- from javax .swing import JTabbedPane , JPanel , JButton , JLabel , SwingConstants , JOptionPane , GroupLayout , JCheckBox , JSplitPane , JRadioButton , ButtonGroup , JFileChooser
1+ from javax .swing import JTabbedPane , JPanel , JButton , JLabel , JTextField , SwingConstants , JOptionPane , GroupLayout , JCheckBox , JSplitPane , JRadioButton , ButtonGroup , JFileChooser
22from javax .swing .event import ChangeListener , DocumentListener
33from javax .swing .LayoutStyle .ComponentPlacement import RELATED , UNRELATED
4- from java .awt import BorderLayout , Font , Component
4+ from java .awt import BorderLayout , Font , Component , Color
55from java .beans import PropertyChangeListener
66from org .python .core .util import StringUtil
77from burp import IExtensionStateListener
@@ -233,7 +233,7 @@ def set_output_file(self, event=None):
233233 file_chooser = JFileChooser ()
234234 choice = file_chooser .showSaveDialog (None )
235235 if choice == JFileChooser .APPROVE_OPTION :
236- self .outputFileLabel .text = file_chooser .selectedFile .path
236+ self .outputFileTextField .text = file_chooser .selectedFile .path
237237 self .output_file = open (file_chooser .selectedFile .path , 'a' )
238238 self .script .stdout = self .output_file
239239 return True
@@ -250,7 +250,7 @@ def propertyChange(self, event):
250250
251251 def extensionUnloaded (self ):
252252 if self .output_file : # if we have a file ref then close it
253- print ('Closing output file reference' )
253+ print ('Closing output file reference for script: \' {} \' ' . format ( self . script . title ) )
254254 self .output_file .close ()
255255
256256 def _create_output_panel (self ):
@@ -262,7 +262,7 @@ def _create_output_panel(self):
262262 self .outputButtonGroup = ButtonGroup ()
263263 self .outputFileRadioButton = JRadioButton ('Save to File:' , actionPerformed = self .save_file_output )
264264 self .outputUIRadioButton = JRadioButton ('Show in UI:' , selected = True , actionPerformed = self .view_ui_output )
265- self .outputFileLabel = JLabel ( )
265+ self .outputFileTextField = JTextField ( 50 , enabled = False , disabledTextColor = Color . black )
266266 self .outputFileBrowseButton = JButton ('Browse...' , enabled = False , actionPerformed = self .set_output_file )
267267
268268 self .outputButtonGroup .add (self .outputFileRadioButton )
@@ -273,7 +273,7 @@ def _create_output_panel(self):
273273 .addGroup (
274274 outputLayout .createSequentialGroup ()
275275 .addComponent (self .outputFileRadioButton )
276- .addComponent (self .outputFileLabel )
276+ .addComponent (self .outputFileTextField , GroupLayout . DEFAULT_SIZE , GroupLayout . DEFAULT_SIZE , GroupLayout . PREFERRED_SIZE )
277277 .addComponent (self .outputFileBrowseButton )
278278 )
279279 .addComponent (self .outputUIRadioButton )
@@ -285,7 +285,7 @@ def _create_output_panel(self):
285285 .addGroup (
286286 outputLayout .createParallelGroup ()
287287 .addComponent (self .outputFileRadioButton )
288- .addComponent (self .outputFileLabel )
288+ .addComponent (self .outputFileTextField , GroupLayout . DEFAULT_SIZE , GroupLayout . DEFAULT_SIZE , GroupLayout . PREFERRED_SIZE )
289289 .addComponent (self .outputFileBrowseButton )
290290 )
291291 .addComponent (self .outputUIRadioButton )
0 commit comments