RPTools / maptool

Virtual Tabletop for playing roleplaying games with remote players or face to face.
http://rptools.net
GNU Affero General Public License v3.0
800 stars 262 forks source link

Apply changes made to token properties in the campaign settings when pressing "Ok" #4863

Closed maltedreschert closed 3 months ago

maltedreschert commented 3 months ago

Identify the Bug or Feature request

fixes 4710

Description of the Change

When editing a cell in the campaign settings token table by double clicking on a Cell in the JTable, a TableCellEditor is created, that enables changing the value of the cell. This editor needs to be closed to apply the changes. By default this is done, by clicking inside the JTable again, outside of the currently selected cell, or programmatically by calling JTable().getCellEditor().stopCellEditing(). The public method finalizeCellEditing() was added to the TokenPropertiesManagementPanel that checks, if the JTable is in edit mode and if yes, calls stopCellEditing(). The method now can be called when pressing the "Ok" button in the CampaignPropertiesDialog to first apply the changes before closing the campaign editor. The call is also added to functions initPropertyMoveUpButton and initPropertyMoveDownButton for moving, initPropertyDeleteButton for deleting a property and initPropertyAddButton for adding properties because doing that will also cause problems with duplicated entries and OutOfBoundsExceptions.

Possible Drawbacks

No drawbacks known

Documentation Notes

N/A

Release Notes


This change is Reviewable