Editor Toolbar Updates:

- Fix for unnecessary table toolbar refresh when the user click on another cell in the same table.
 - Fix for issue where table toolbar does not update when using arrow keys to move from the table to the header.
This commit is contained in:
Scotthew 2014-05-17 22:32:43 -07:00 committed by Dale Schultz
parent b6f5ba6a92
commit 85e7087a95
3 changed files with 12 additions and 0 deletions

View File

@ -1019,6 +1019,7 @@ public abstract class Table extends JPanel implements Serializable {
clearSelection(); clearSelection();
data[y].setSelected(true); data[y].setSelected(true);
highlightY = y; highlightY = y;
ECUEditorManager.getECUEditor().getTableToolBar().updateTableToolBar(this);
} }
} }

View File

@ -596,6 +596,7 @@ public class Table3D extends Table {
} else { // y axis } else { // y axis
selectCellAt(y, 0); selectCellAt(y, 0);
} }
ECUEditorManager.getECUEditor().getTableToolBar().updateTableToolBar(this);
} }
public void deSelectCellAt(int x, int y) { public void deSelectCellAt(int x, int y) {

View File

@ -305,6 +305,16 @@ public class TableToolBar extends JToolBar implements MouseListener, ItemListene
} }
public void updateTableToolBar(Table selectedTable) { public void updateTableToolBar(Table selectedTable) {
if(selectedTable == null && this.selectedTable == null) {
// Skip if the table is the same to avoid multiple updates
return;
} else if(selectedTable == null || this.selectedTable == null) {
// Update the toolbar.
} else if(this.selectedTable.equals(selectedTable)) {
// Skip if the table is the same to avoid multiple updates
return;
}
this.selectedTable = selectedTable; this.selectedTable = selectedTable;
setBorder(toolbarBorder); setBorder(toolbarBorder);