Repository navigation
Added support for custom cell highlighting to DynamicTableControl:
# Fetch the native DynamicTable control by its identifier
dynamic_table_control = main_tab.getControl("characters_table")
# Customize highlighting such that negative values are highlighted RED when the character IS NOT a force user
dynamic_table_control.addCellHighlighter(Java::JavaAwt::Color::RED) do |cell_info|
# cell_info is a DynamicTableControl.CellInfo instance, which contains various info we can make use of:
cell_value = cell_info.value
row = cell_info.row
col = cell_info.column
record = cell_info.rowRecord # In case you want to inspect other values in that row
highlight_it = cell_value.is_a?(Integer) && cell_value <= 0
next highlight_it
end
# Customize highlighting such that negative values are highlighted YELLOW when the character IS a force user
dynamic_table_control.addCellHighlighter(Java::JavaAwt::Color::YELLOW) do |cell_info|
# cell_info is a DynamicTableControl.CellInfo instance, which contains various info we can make use of:
cell_value = cell_info.value
row = cell_info.row
col = cell_info.column
record = cell_info.rowRecord # In case you want to inspect other values in that row
highlight_it = record[:hasForce] && cell_value.is_a?(Integer) && cell_value <= 0
next highlight_it
endFull example located in DynamicTableTest04.rb