Interface TableColumn

    • Method Detail

      • initialize

        void initialize​(int iAlignment,
                        int iPosition,
                        int iWidth)
        Initialize a group of variables all at once. Saves on individual setXxx.
        Parameters:
        iAlignment - See setAlignment(int)
        iPosition - See setPosition(int)
        iWidth - See setWidth(int)
        Since:
        2.1.0.0
      • getNameOverride

        java.lang.String getNameOverride()
        Returns the user's column name override if it exists
        Returns:
        Since:
        5.0.0.1
      • setNameOverride

        void setNameOverride​(java.lang.String name)
      • setType

        void setType​(int type)
        The type of the contained data.
        Current supported types are long, string, and graphic.

        NOTE: This MUST be set BEFORE adding the column to a table.
        The default type is TYPE_TEXT_ONLY.

        Parameters:
        type - TYPE_TEXT, TYPE_TEXT_ONLY, TYPE_GRAPHIC
        Since:
        2.1.0.0
      • getType

        int getType()
        Returns the type of the contained data.
        Returns:
        type TYPE_TEXT, or TYPE_GRAPHIC
        Since:
        2.1.0.0
      • setWidth

        void setWidth​(int unadjustedWidth)
        The column size.

        NOTE: This MUST be set BEFORE adding the column to a table.

        Parameters:
        width - the size in pixels, adjusting for DPI
        Since:
        2.1.0.0
      • setWidthPX

        void setWidthPX​(int realPixelWidth)
      • getWidth

        int getWidth()
        Returns the column's size
        Returns:
        width in pixels
        Since:
        2.1.0.0
      • setPosition

        void setPosition​(int position)
        Location to put the column. When set before being added to the UI (see TableManager.addColumn(com.biglybt.pif.ui.tables.TableColumn)), the supplied value will be used as the default position. If the user has moved the column previously, the new position will be used, and the default position will be ignored. This function cannot be called after you have added the column to a UI table. In the future, setting the position after adding the column to the UI table will result in the column being moved.
        Parameters:
        position - Column Number (0 based), POSITION_INVISIBLE or POSITION_LAST
        Since:
        2.1.0.0
      • getPosition

        int getPosition()
        Returns the position of the column
        Returns:
        Column Number (0 based), POSITION_INVISIBLE or POSITION_LAST
        Since:
        2.1.0.0
      • setAlignment

        void setAlignment​(int alignment)
        Orientation of the columns text and header.

        NOTE: This MUST be set BEFORE adding the column to a table.

        Parameters:
        alignment - ALIGN_TRAIL, ALIGN_LEAD, or ALIGN_CENTER
        Since:
        2.1.0.0
      • getAlignment

        int getAlignment()
        Returns the alignment of the column
        Returns:
        ALIGN_TRAIL, ALIGN_LEAD, or ALIGN_CENTER
        Since:
        2.1.0.0
      • setRefreshInterval

        void setRefreshInterval​(int interval)
        Set how often the cell receives a refresh() trigger
        Parameters:
        interval - INTERVAL_GRAPHIC, INTERVAL_LIVE, INTERVAL_INVALID_ONLY constants, or an integer based on the user-configurable "GUI refresh interval". For example, specifying 4 will result in a refresh trigger every 4 "GUI refresh intervals"
        Since:
        2.1.0.0
      • getRefreshInterval

        int getRefreshInterval()
        Returns the refresh interval of the column. The default is INTERVAL_INVALID_ONLY
        Returns:
        INTERVAL_* constant, or a number representing the # of GUI refresh cycles between each cell refresh call.
        Since:
        2.1.0.0
      • setMinWidth

        void setMinWidth​(int minwidth)
        Sets the minimum width that the column can be before other columns start collapsing. This may not prevent the user from resizing the column smaller than specified.

        If not set, the width specified on initialize will be the minimum width

        Not all UIs may have this feature implemented.

        Parameters:
        minwidth - new minumum width
        Since:
        3.0.0.7
      • getMinWidth

        int getMinWidth()
        Gets the minimum width that the column can be before other columns start collapsing.

        If not set, the width specified on initialize will be the minimum width

        Not all UIs may have this feature implemented.

        Returns:
        minumum width of the column
        Since:
        3.0.0.7
      • setMaxWidth

        void setMaxWidth​(int maxwidth)
        Sets the maximum width that the column can be

        Not all UIs may have this feature implemented.

        Parameters:
        maxwidth - new maximum width
        Since:
        3.0.0.7
      • getMaxWidth

        int getMaxWidth()
        Gets the maximum width the column can be

        Not all UIs may have this feature implemented.

        Returns:
        maximum width of column
        Since:
        3.0.0.7
      • setWidthLimits

        void setWidthLimits​(int min,
                            int max)
        Sets the minimum and maximum widths in one call

        Not all UIs may have this min and max limits implemented.

        Parameters:
        min - New minimum column width
        max - New maximum column width
        Since:
        3.0.0.7
      • setPreferredWidth

        void setPreferredWidth​(int width)
        Sets the preferred width of the column. When the UI is in auto-expand mode and space is made available, the columns will first fill to their preferred width, then to their maximum width.
        Parameters:
        width - New preferred width
        Since:
        3.0.0.7
      • getPreferredWidth

        int getPreferredWidth()
        Gets the preferred width of the coloumn.
        Returns:
        preferred width
        Since:
        3.0.0.7
      • isPreferredWidthAuto

        boolean isPreferredWidthAuto()
        Retrieves whether the preferred width is automatically calculated.
        Returns:
        preferred width auto calculation state
        Since:
        3.0.0.7
      • setPreferredWidthAuto

        void setPreferredWidthAuto​(boolean auto)
        Sets whether the preferred with is automatically calculated. An automatically calculated preferred width will be set to the largest text width known to that column
        Parameters:
        auto - Preferred Width Auto State
        Since:
        3.0.0.7
      • isVisible

        boolean isVisible()
        Gets the visibility of the column

        Not all UIs may have this feature implemented.

        Returns:
        Column visibility
        Since:
        3.0.0.7
      • setUserData

        void setUserData​(java.lang.String key,
                         java.lang.Object value)
        Associates custom data with the column, usually meant for column-specific settings and stores it across sessions
        Parameters:
        key - the key under which the value will be stored and serialized
        value - should be BEncodable, otherwise it won't be serialized
      • removeUserData

        void removeUserData​(java.lang.String key)
      • postConfigLoad

        void postConfigLoad()
        implement this method if you want to be notified when the stored column configuration such as user data or GUI-adjustable properties have been loaded
      • preConfigSave

        void preConfigSave()
        implement this method if you want to be notified when the column configuration is about to be serialized
      • getUserData

        java.lang.Object getUserData​(java.lang.String key)
        Parameters:
        key -
        Returns:
        data set via setUserData()
      • getUserDataString

        java.lang.String getUserDataString​(java.lang.String key)
      • setVisible

        void setVisible​(boolean visible)
        Sets the visibility of the column
        Parameters:
        visible - New visibility state
        Since:
        3.0.0.7
      • addCellRefreshListener

        void addCellRefreshListener​(TableCellRefreshListener listener)
        Adds a listener that triggers when a TableCell that belongs to this column needs refreshing.
        Parameters:
        listener - Listener Object to be called when refresh is needed.
        Since:
        2.1.0.0
      • removeCellRefreshListener

        void removeCellRefreshListener​(TableCellRefreshListener listener)
        Removed a previously added TableCellRefreshListener
        Parameters:
        listener - Previously added listener
        Since:
        2.1.0.0
      • addCellAddedListener

        void addCellAddedListener​(TableCellAddedListener listener)
        Adds a listener that triggers when a TableCell that belongs to this column is being added.
        Parameters:
        listener - Listener Object to be called when refresh is needed.
        Since:
        2.1.0.0
      • addCellDisposeListener

        void addCellDisposeListener​(TableCellDisposeListener listener)
        Adds a listener that triggers when a TableCell that belongs to this column is being disposed.
        Parameters:
        listener - Listener Object to be called when refresh is needed.
        Since:
        2.1.0.0
      • addCellToolTipListener

        void addCellToolTipListener​(TableCellToolTipListener listener)
        Adds a listener that triggers when a TableCell that belongs to this column has a tooltip action
        Parameters:
        listener - Listener Object to be called when refresh is needed.
        Since:
        2.1.0.2
      • addCellMouseListener

        void addCellMouseListener​(TableCellMouseListener listener)
        Adds a listener that triggers when a TableCell that belongs to this column has a mouse event.
        Parameters:
        listener -
        Since:
        2.3.0.7
      • removeCellMouseListener

        void removeCellMouseListener​(TableCellMouseListener listener)
        Remove a previously added TableCellMouseListener
        Parameters:
        listener - Previously added listener
        Since:
        2.3.0.7
      • addListeners

        void addListeners​(java.lang.Object listenerObject)
        A listener is added for every type of cell listener the supplied object implements
        Parameters:
        listenerObject - Object implementing some cell listeneters
        Since:
        2.4.0.0
      • invalidateCells

        void invalidateCells()
        Invalidate all cells in this column. The cells will be forced to update on the next refresh.
        Since:
        2.1.0.0
      • invalidateCell

        void invalidateCell​(java.lang.Object data_source)
        Invalidates any cells which are linked to the given data source object.
        Since:
        3.0.1.5
      • addContextMenuItem

        TableContextMenuItem addContextMenuItem​(java.lang.String resourceKey,
                                                int menuStyle)
        Adds a Context Menu item to the column
        Parameters:
        resourceKey - ID of the context menu, which is also used to retreieve the textual name from the plugin language file.
        menuStyle - See MENU_STYLE_* constants (header or data)
        Returns:
        a newly created menu item
        Since:
        4.2.0.5
      • addContextMenuItem

        TableContextMenuItem addContextMenuItem​(java.lang.String resourceKey)
        Adds a Context Menu item to data section of the column
        Parameters:
        resourceKey - ID of the context menu, which is also used to retreieve the textual name from the plugin language file.
        Returns:
        a newly created menu item
        Since:
        2.4.0.0
      • isObfuscated

        boolean isObfuscated()
        Returns whether the column's data will be obfuscated when screen capturing (for bug reports, etc).

        Currently not fully implemented for plugins

        Returns:
        Obfuscated value
        Since:
        2.4.0.3
      • setObfuscation

        void setObfuscation​(boolean hideData)
        Sets whether the column's data will be obfuscated during a screen capture (for bug reports, etc).
        Parameters:
        hideData - new state of obfuscation
        Since:
        2.4.0.3
      • remove

        void remove()
        Since:
        4005
      • addColumnExtraInfoListener

        void addColumnExtraInfoListener​(TableColumnExtraInfoListener listener)
        Parameters:
        listener -
        Since:
        4.0.0.5
      • removeColumnExtraInfoListener

        void removeColumnExtraInfoListener​(TableColumnExtraInfoListener listener)
        Parameters:
        listener -
        Since:
        4.0.0.5
      • getForDataSourceType

        java.lang.Class getForDataSourceType()
        Returns:
        Since:
        4.0.0.5
      • setIconReference

        void setIconReference​(java.lang.String iconID,
                              boolean showOnlyIcon)
        Since:
        4.4.0.7
      • getIconReference

        java.lang.String getIconReference()
        Since:
        4.4.0.7
      • setMinimumRequiredUserMode

        void setMinimumRequiredUserMode​(int mode)
        *since 4501
        Parameters:
        mode - from Parameter. constants