java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollPane
com.jackmeng.halcyoninae.cosmos.components.info.layout.FileFromSourceTab
All Implemented Interfaces:
InformationTab, ImageObserver, MenuContainer, Serializable, Accessible, ScrollPaneConstants

public class FileFromSourceTab extends JScrollPane implements InformationTab
This is a special tab that can be used to write pure text to. The programmar can also decide to use the builtin getContent(String) method to read the contents of a file. All content can be in HTML or standard TEXT
Since:
3.2
Author:
Jack Meng
See Also:
  • Field Details

  • Constructor Details

    • FileFromSourceTab

      public FileFromSourceTab(String tabName, String textTab)
      Two arguments are accepted in the construction of this custom tab.
      Parameters:
      tabName - The preferred tab name (should be kept at a small length)
      textTab - The content of the tab getContent(String)
      See Also:
  • Method Details

    • getContent

      public static String getContent(String file)
      If the user decides to read from a file, this method should be used to grab the content of the file. This method should be only used in the constructor of this GUI object.
      Parameters:
      file - A String representing the file location
      Returns:
      String The content of the file in the native encoding.
    • getName

      public String getName()
      Specified by:
      getName in interface InformationTab
      Overrides:
      getName in class Component
      Returns:
      String
    • getToolTip

      public String getToolTip()
      Specified by:
      getToolTip in interface InformationTab
      Returns:
      String
    • getComponent

      public JComponent getComponent()
      Specified by:
      getComponent in interface InformationTab
      Returns:
      JComponent