Class CustomColumn<X>

java.lang.Object
gg.xp.xivsupport.gui.tables.CustomColumn<X>

public class CustomColumn<X> extends Object
  • Constructor Details

    • CustomColumn

      public CustomColumn(String columnName, Function<X,@Nullable Object> getter)
    • CustomColumn

      public CustomColumn(String columnName, Function<X,@Nullable Object> getter, Consumer<TableColumn> columnConfigurer)
      Custom table column
      Parameters:
      columnName - Name of the column
      getter - Function to convert an instance in the table to whatever this column cares about. Note that this is executed **in the table rendering code** so it should under no circumstances involve non-trivial computation or access.
      columnConfigurer - Lets you configure the column, e.g. to override the renderer.
    • CustomColumn

      public CustomColumn(String columnName, Function<X,@Nullable Object> getter, int fixedWidth)
  • Method Details

    • getColumnName

      public String getColumnName()
    • getValue

      public Object getValue(X item)
    • configureColumn

      public void configureColumn(TableColumn column)
    • withExtraConfig

      public CustomColumn<X> withExtraConfig(Consumer<TableColumn> extraColumnConfigurer)
    • withFilter

      public CustomColumn<X> withFilter(Function<Runnable,VisualFilter<? super X>> filterCreator)
      Associates a visual filter with this column.
      Parameters:
      filterCreator - a function that creates a VisualFilter given a callback to run when the filter is updated.
      Returns:
      this column instance for chaining.
    • getFilter

      @Nullable public @Nullable VisualFilter<? super X> getFilter(Runnable onUpdate)
      Returns the filter associated with this column, if any.
      Parameters:
      onUpdate - a callback to run when the filter is updated.
      Returns:
      the visual filter, or null if no filter is associated.