Class TableContentPanel

  • All Implemented Interfaces:
    adams.core.CleanUpHandler, adams.data.spreadsheet.SpreadSheetSupporter, adams.gui.core.PopupMenuProvider, ImageObserver, MenuContainer, Serializable, Accessible

    public class TableContentPanel
    extends AbstractOutputPanelWithPopupMenu<adams.gui.chooser.SpreadSheetFileChooser>
    implements adams.data.spreadsheet.SpreadSheetSupporter
    Panel for exporting the table as spreadsheet.
    Version:
    $Revision$
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Component

        protected JComponent m_Component
        the actual component.
      • m_PanelSearch

        protected adams.gui.core.SearchPanel m_PanelSearch
        the search panel.
    • Constructor Detail

      • TableContentPanel

        public TableContentPanel​(JTable comp,
                                 boolean useScrollPane)
        Initializes the panel with the specified textual component.
        Parameters:
        comp - the component to embed
        useScrollPane - whether to use a scroll pane
      • TableContentPanel

        public TableContentPanel​(adams.gui.core.BaseTable comp,
                                 boolean useScrollPane)
        Initializes the panel with the specified textual component.
        Parameters:
        comp - the component to embed
        useScrollPane - whether to use a scroll pane
      • TableContentPanel

        public TableContentPanel​(adams.gui.core.BaseTableWithButtons comp,
                                 boolean useScrollPane)
        Initializes the panel with the specified textual component.
        Parameters:
        comp - the component to embed
        useScrollPane - whether to use a scroll pane
      • TableContentPanel

        public TableContentPanel​(adams.gui.core.SortableAndSearchableTable comp,
                                 boolean useScrollPane,
                                 boolean searchable)
        Initializes the panel with the specified textual component.
        Parameters:
        comp - the component to embed
        useScrollPane - whether to use a scroll pane
        searchable - whether the table is searchable
      • TableContentPanel

        public TableContentPanel​(adams.gui.core.SortableAndSearchableTableWithButtons comp,
                                 boolean useScrollPane,
                                 boolean searchable)
        Initializes the panel with the specified textual component.
        Parameters:
        comp - the component to embed
        useScrollPane - whether to use a scroll pane
        searchable - whether the table is searchable
    • Method Detail

      • initGUI

        protected void initGUI​(JComponent comp,
                               boolean useScrollPane)
        Initializes the panel with the specified component.
        Parameters:
        comp - the component to embed
        useScrollPane - whether to use a scroll pane
      • initGUI

        protected void initGUI​(JComponent comp,
                               boolean useScrollPane,
                               boolean searchable)
        Initializes the panel with the specified component.
        Parameters:
        comp - the component to embed
        useScrollPane - whether to use a scroll pane
        searchable - whether the table is searchable
      • getComponent

        public JComponent getComponent()
        Returns the embedded component.
        Returns:
        the component
      • createFileChooser

        protected adams.gui.chooser.SpreadSheetFileChooser createFileChooser()
        Creates the filechooser to use.
        Specified by:
        createFileChooser in class AbstractOutputPanelWithPopupMenu<adams.gui.chooser.SpreadSheetFileChooser>
        Returns:
        the filechooser
      • save

        protected String save​(File file)
        Saves the content to the specified file.
        Specified by:
        save in class AbstractOutputPanelWithPopupMenu<adams.gui.chooser.SpreadSheetFileChooser>
        Parameters:
        file - the file to save to
        Returns:
        null if successful, otherwise error message
      • toSpreadSheet

        public adams.data.spreadsheet.SpreadSheet toSpreadSheet()
        Returns the content as spreadsheet.
        Specified by:
        toSpreadSheet in interface adams.data.spreadsheet.SpreadSheetSupporter
        Returns:
        the content