mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
Fixed the structure editor sometimes losing focus when editing data
types
This commit is contained in:
parent
179f093aca
commit
c7b4c69720
3 changed files with 25 additions and 13 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue