22import java.awt.BorderLayout;
 
   24import java.io.PrintWriter;
 
   25import java.io.StringWriter;
 
   26import java.util.concurrent.atomic.AtomicInteger;
 
   28import javax.swing.BorderFactory;
 
   29import javax.swing.JButton;
 
   30import javax.swing.JTextPane;
 
   31import javax.swing.border.Border;
 
   32import javax.swing.border.TitledBorder;
 
   34import denoptim.exception.DENOPTIMException;
 
   35import denoptim.io.DenoptimIO;
 
   69        super.setLayout(
new BorderLayout());
 
   81        this.setLayout(
new BorderLayout()); 
 
   88        Border bevel = BorderFactory.createLoweredBevelBorder();
 
   89        border = BorderFactory.createTitledBorder(bevel, 
"No source of text");
 
   90        border.setTitleJustification(TitledBorder.CENTER);
 
   92        this.add(
txtPane,BorderLayout.CENTER);
 
   96        this.add(commandsPane, BorderLayout.SOUTH);
 
   97        JButton btnCanc = 
new JButton(
"Close Tab");
 
   98        btnCanc.setToolTipText(
"Closes this FSERun Inspector.");
 
  100        commandsPane.
add(btnCanc);
 
  111        String fileID = file.getAbsolutePath();
 
  112        if (file.getAbsolutePath().length() > 80)
 
  113            fileID = file.getName();
 
  123            StringWriter sw = 
new StringWriter();
 
  124            PrintWriter pw = 
new PrintWriter(sw);
 
  125            e.printStackTrace(pw);
 
  126            String sStackTrace = sw.toString(); 
 
  127            txtPane.setText(
"Could not read content of file: "  
  128                 + System.getProperty(
"line.separator") 
 
  138        border.setTitle(
"Content of " + 
string);
 
Remove the card from the deck of cards and takes care of removing also the entry in the list of activ...
Class of GUI panels meant to occupy one card in the deck-of-cards layout of the main panel.
GUIMainPanel mainPanel
The main panel (cards deck)
The main panel is a deck of cards that occupies all the GUI frame.
A panel that allows to print the content of a text file into a GUI tab.
GUITextReader(GUIMainPanel mainPanel)
Constructor.
void setSourceTitle(String string)
static AtomicInteger texReaderTabUID
Unique identified for instances of this handler.
static final long serialVersionUID
Version UID.
void initialize()
Initialize the panel and add buttons.
void displayContent(File file)
Print the content of the given file in this tab's pane.
Utility methods for input/output.
static String readText(String fileName)
Read text from file.