mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Fixed the structure editor sometimes losing focus when editing data
types
This commit is contained in:
@@ -940,22 +940,26 @@ public class GTable extends JTable {
|
||||
public boolean editCellAt(int row, int column, EventObject e) {
|
||||
boolean editAtCell = super.editCellAt(row, column, e);
|
||||
if (editAtCell) {
|
||||
TableCellEditor currentEditor = getCellEditor();
|
||||
Component editorComponent = getEditorComponent();
|
||||
if (currentEditor instanceof FocusableEditor focusable) {
|
||||
focusable.focusEditor();
|
||||
}
|
||||
else {
|
||||
editorComponent.requestFocusInWindow();
|
||||
}
|
||||
|
||||
if (editorComponent instanceof JTextComponent textComponent) {
|
||||
textComponent.selectAll();
|
||||
}
|
||||
requestTableFocus();
|
||||
}
|
||||
return editAtCell;
|
||||
}
|
||||
|
||||
public void requestTableFocus() {
|
||||
TableCellEditor currentEditor = getCellEditor();
|
||||
Component editorComponent = getEditorComponent();
|
||||
if (currentEditor instanceof FocusableEditor focusable) {
|
||||
focusable.focusEditor();
|
||||
}
|
||||
else {
|
||||
editorComponent.requestFocusInWindow();
|
||||
}
|
||||
|
||||
if (editorComponent instanceof JTextComponent textComponent) {
|
||||
textComponent.selectAll();
|
||||
}
|
||||
}
|
||||
|
||||
public void scrollToSelectedRow() {
|
||||
int[] selectedRows = getSelectedRows();
|
||||
if (selectedRows == null || selectedRows.length == 0) {
|
||||
|
||||
Reference in New Issue
Block a user