Class TablePopup<S>

  • Type Parameters:
    S - the table element type

    public class TablePopup<S>
    extends java.lang.Object
    Table popup.
    Provides a context menu with several handy features such as export to excel, save and load table settings, etc...
    Author:
    harald
    • Constructor Summary

      Constructors 
      Constructor Description
      TablePopup​(org.tentackle.fx.component.FxTableView<S> table, java.lang.String preferencesSuffix, boolean noViewSize, java.lang.String title)
      Creates a table popup.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void autoWidth()
      Resizes all columns to fit their content.
      javafx.scene.control.ContextMenu createContextMenu()
      Creates the context menu.
      java.lang.String getPreferencesSuffix()
      Gets the table preferences suffix.
      org.tentackle.fx.component.FxTableView<S> getTable()
      Gets the table.
      java.lang.String getTitle()
      Gets the printed title.
      boolean isColumnMenuEnabled()
      Returns whether the column menu is enabled.
      void loadPreferences()
      Loads the table preferences.
      System- or user scope is determined from PersistedPreferencesFactory.
      void loadPreferences​(boolean system)
      Loads the table preferences.
      void print()
      Prints the table.
      void savePreferences()
      Saves the table preferences.
      System- or user scope is determined from PersistedPreferencesFactory.
      void savePreferences​(boolean system)
      Saves the table preferences.
      void setColumnMenuEnabled​(boolean columnMenuEnabled)
      Enables or disables the column menu.
      The column menu allows to set the visibility of columns.
      void toSpreadsheet​(boolean onlySelected)
      Opens a dialog to export a table to an Excel sheet.
      void toXml​(boolean onlySelected)
      Opens a dialog to export a table to a spreadsheet.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TablePopup

        public TablePopup​(org.tentackle.fx.component.FxTableView<S> table,
                          java.lang.String preferencesSuffix,
                          boolean noViewSize,
                          java.lang.String title)
        Creates a table popup.
        Parameters:
        table - the table
        preferencesSuffix - the preferences suffix to load/save table preferences
        noViewSize - true if don't set the table view's size
        title - the title of the printed table
    • Method Detail

      • getTable

        public org.tentackle.fx.component.FxTableView<S> getTable()
        Gets the table.
        Returns:
        the table
      • getTitle

        public java.lang.String getTitle()
        Gets the printed title.
        Returns:
        the title
      • getPreferencesSuffix

        public java.lang.String getPreferencesSuffix()
        Gets the table preferences suffix.
        Returns:
        the suffix
      • isColumnMenuEnabled

        public boolean isColumnMenuEnabled()
        Returns whether the column menu is enabled.
        Returns:
        true if column menu is enabled
      • setColumnMenuEnabled

        public void setColumnMenuEnabled​(boolean columnMenuEnabled)
        Enables or disables the column menu.
        The column menu allows to set the visibility of columns.
        Parameters:
        columnMenuEnabled - true to enable column menu (default)
      • createContextMenu

        public javafx.scene.control.ContextMenu createContextMenu()
        Creates the context menu.
        Returns:
        the context menu
      • autoWidth

        public void autoWidth()
        Resizes all columns to fit their content.
      • print

        public void print()
        Prints the table.
      • toSpreadsheet

        public void toSpreadsheet​(boolean onlySelected)
        Opens a dialog to export a table to an Excel sheet.
        Parameters:
        onlySelected - true if export only selected rows
      • toXml

        public void toXml​(boolean onlySelected)
        Opens a dialog to export a table to a spreadsheet.
        Parameters:
        onlySelected - true if export only selected rows
      • savePreferences

        public void savePreferences​(boolean system)
        Saves the table preferences.
        Parameters:
        system - true if system scope, else user
      • savePreferences

        public void savePreferences()
        Saves the table preferences.
        System- or user scope is determined from PersistedPreferencesFactory.
      • loadPreferences

        public void loadPreferences​(boolean system)
        Loads the table preferences.
        Parameters:
        system - true if from system scope only, else try user first
      • loadPreferences

        public void loadPreferences()
        Loads the table preferences.
        System- or user scope is determined from PersistedPreferencesFactory.