Class SpreadSheetPanel

    • Field Detail

      • m_Table

        protected SpreadSheetTable m_Table
        the table for displaying the spreadsheet.
      • m_MenuBar

        protected JMenuBar m_MenuBar
        the menu bar, if used.
      • m_MenuItemFileSaveAs

        protected JMenuItem m_MenuItemFileSaveAs
        the "save as" menu item.
      • m_MenuItemFileExit

        protected JMenuItem m_MenuItemFileExit
        the "exit" menu item.
      • m_MenuItemViewDisplayedDecimals

        protected JMenuItem m_MenuItemViewDisplayedDecimals
        the "displayed decimals" menu item.
      • m_MenuItemViewRendering

        protected JMenuItem m_MenuItemViewRendering
        the "negative background" menu item.
      • m_MenuItemViewPositiveBackground

        protected JMenuItem m_MenuItemViewPositiveBackground
        the "positive background" menu item.
      • m_MenuItemViewShowFormulas

        protected JMenuItem m_MenuItemViewShowFormulas
        the "show formulas" menu item.
      • m_PanelSearch

        protected SearchPanel m_PanelSearch
        the search panel.
      • m_PanelColumnComboBox

        protected JPanel m_PanelColumnComboBox
        the panel for the column combobox.
    • Constructor Detail

      • SpreadSheetPanel

        public SpreadSheetPanel()
    • Method Detail

      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class BasePanel
      • initGUI

        protected void initGUI()
        Initializes the widgets.
        Overrides:
        initGUI in class BasePanel
      • setSpreadSheet

        public void setSpreadSheet​(SpreadSheet value)
        Sets the spreadsheet to display.
        Parameters:
        value - the spreadsheet to display
      • getSpreadSheet

        public SpreadSheet getSpreadSheet()
        Returns the spreadsheet currently displayed.
        Returns:
        the spreadsheet on display
      • getMenuBar

        public JMenuBar getMenuBar()
        Creates a menu bar (singleton per panel object). Can be used in frames.
        Specified by:
        getMenuBar in interface MenuBarProvider
        Returns:
        the menu bar
      • updateMenu

        protected void updateMenu()
        updates the enabled state of the menu items.
      • close

        protected void close()
        Closes the dialog or frame.
      • saveAs

        protected void saveAs()
        Saves the current sheet.
      • write

        public void write​(SpreadSheetWriter writer,
                          File file)
        Saves the specified file.
        Parameters:
        writer - the writer to use for saving the file
        file - the file to save
      • enterNumDecimals

        protected void enterNumDecimals()
        Alows the user to enter the number of decimals to display.
      • selectRendering

        protected void selectRendering()
        Allows the user to select a different cell rendering customizer.
      • hasSendToItem

        public boolean hasSendToItem​(Class[] cls)
        Checks whether something to send is available.
        Specified by:
        hasSendToItem in interface SendToActionSupporter
        Parameters:
        cls - the classes to retrieve the item for
        Returns:
        true if an object is available for sending
      • getSendToItem

        public Object getSendToItem​(Class[] cls)
        Returns the object to send.
        Specified by:
        getSendToItem in interface SendToActionSupporter
        Parameters:
        cls - the classes to retrieve the item for
        Returns:
        the item to send
      • setHeaderPopupMenuCustomizer

        public void setHeaderPopupMenuCustomizer​(PopupMenuCustomizer value)
        Sets the popup menu customizer to use for the header.
        Parameters:
        value - the customizer, null to remove it
      • getHeadePopupMenuCustomizer

        public PopupMenuCustomizer getHeadePopupMenuCustomizer()
        Returns the current popup menu customizer for the header.
        Returns:
        the customizer, null if none set
      • setCellPopupMenuCustomizer

        public void setCellPopupMenuCustomizer​(PopupMenuCustomizer value)
        Sets the popup menu customizer to use for the cells.
        Parameters:
        value - the customizer, null to remove it
      • getCellPopupMenuCustomizer

        public PopupMenuCustomizer getCellPopupMenuCustomizer()
        Returns the current popup menu customizer for the cells.
        Returns:
        the customizer, null if none set
      • setCellRenderingCustomizer

        public void setCellRenderingCustomizer​(CellRenderingCustomizer value)
        Sets the renderer.
        Parameters:
        value - the renderer
      • getCellRenderingCustomizer

        public CellRenderingCustomizer getCellRenderingCustomizer()
        Returns the renderer.
        Returns:
        the renderer
      • setShowFormulas

        public void setShowFormulas​(boolean value)
        Sets whether to display the formulas or their calculated values.
        Parameters:
        value - true if to display the formulas rather than the calculated values
      • getShowFormulas

        public boolean getShowFormulas()
        Returns whether to display the formulas or their calculated values.
        Returns:
        true if to display the formulas rather than the calculated values
      • sort

        public void sort​(RowComparator comparator)
        Sorts the spreadsheet with the given comparator.
        Parameters:
        comparator - the row comparator to use
      • setNumDecimals

        public void setNumDecimals​(int value)
        Sets the number of decimals to display. Use -1 to display all.
        Parameters:
        value - the number of decimals
      • getNumDecimals

        public int getNumDecimals()
        Returns the currently set number of decimals. -1 if displaying all.
        Returns:
        the number of decimals
      • setShowSearch

        public void setShowSearch​(boolean value)
        Sets whether the search is visible.
        Parameters:
        value - true if to show search
      • getShowSearch

        public boolean getShowSearch()
        Returns whether the search is visible.
        Returns:
        true if search is shown
      • setShowColumnComboBox

        public void setShowColumnComboBox​(boolean value)
        Sets whether the column combobox is visible.
        Parameters:
        value - true if to show column combobox
      • getShowColumnComboBox

        public boolean getShowColumnComboBox()
        Returns whether the column combobox is visible.
        Returns:
        true if column combobox is shown
      • setUseSimpleHeader

        public void setUseSimpleHeader​(boolean value)
        Whether to display a simple header or an HTML one with the column indices.
        Parameters:
        value - true if to display simple header
      • getUseSimpleHeader

        public boolean getUseSimpleHeader()
        Returns whether to display a simple header or an HTML one with the column indices.
        Returns:
        true if simple header displayed
      • setShowRowColumn

        public void setShowRowColumn​(boolean value)
        Whether to display the column with the row numbers.
        Parameters:
        value - true if to display column
      • getShowRowColumn

        public boolean getShowRowColumn()
        Returns whether the column with the row numbers is displayed.
        Returns:
        true if column displayed