focus after operation
This commit is contained in:
parent
2de5cf6bc4
commit
896eafe62b
@ -1024,6 +1024,10 @@ public class MainWindow extends JFrame {
|
|||||||
performFileOperation((callback) -> {
|
performFileOperation((callback) -> {
|
||||||
FileOperations.copy(selectedItems, targetDir, callback);
|
FileOperations.copy(selectedItems, targetDir, callback);
|
||||||
}, "Copy completed", true, targetPanel);
|
}, "Copy completed", true, targetPanel);
|
||||||
|
} else {
|
||||||
|
if (activePanel != null && activePanel.getFileTable() != null) {
|
||||||
|
activePanel.getFileTable().requestFocusInWindow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1052,6 +1056,10 @@ public class MainWindow extends JFrame {
|
|||||||
performFileOperation((callback) -> {
|
performFileOperation((callback) -> {
|
||||||
FileOperations.move(selectedItems, targetDir, callback);
|
FileOperations.move(selectedItems, targetDir, callback);
|
||||||
}, "Move completed", false, activePanel, targetPanel);
|
}, "Move completed", false, activePanel, targetPanel);
|
||||||
|
} else {
|
||||||
|
if (activePanel != null && activePanel.getFileTable() != null) {
|
||||||
|
activePanel.getFileTable().requestFocusInWindow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1104,8 +1112,13 @@ public class MainWindow extends JFrame {
|
|||||||
if (targetRow >= rowCount) targetRow = rowCount - 1; // move up if needed
|
if (targetRow >= rowCount) targetRow = rowCount - 1; // move up if needed
|
||||||
t.setRowSelectionInterval(targetRow, targetRow);
|
t.setRowSelectionInterval(targetRow, targetRow);
|
||||||
t.scrollRectToVisible(t.getCellRect(targetRow, 0, true));
|
t.scrollRectToVisible(t.getCellRect(targetRow, 0, true));
|
||||||
|
t.requestFocusInWindow();
|
||||||
} catch (Exception ignore) {}
|
} catch (Exception ignore) {}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
if (activePanel != null && activePanel.getFileTable() != null) {
|
||||||
|
activePanel.getFileTable().requestFocusInWindow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1142,6 +1155,9 @@ public class MainWindow extends JFrame {
|
|||||||
|
|
||||||
String zipName = JOptionPane.showInputDialog(this, "Enter zip filename:", defaultName);
|
String zipName = JOptionPane.showInputDialog(this, "Enter zip filename:", defaultName);
|
||||||
if (zipName == null || zipName.trim().isEmpty()) {
|
if (zipName == null || zipName.trim().isEmpty()) {
|
||||||
|
if (activePanel != null && activePanel.getFileTable() != null) {
|
||||||
|
activePanel.getFileTable().requestFocusInWindow();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1157,6 +1173,9 @@ public class MainWindow extends JFrame {
|
|||||||
int confirm = JOptionPane.showConfirmDialog(this,
|
int confirm = JOptionPane.showConfirmDialog(this,
|
||||||
"File already exists. Overwrite?", "Zip", JOptionPane.YES_NO_OPTION);
|
"File already exists. Overwrite?", "Zip", JOptionPane.YES_NO_OPTION);
|
||||||
if (confirm != JOptionPane.YES_OPTION) {
|
if (confirm != JOptionPane.YES_OPTION) {
|
||||||
|
if (activePanel != null && activePanel.getFileTable() != null) {
|
||||||
|
activePanel.getFileTable().requestFocusInWindow();
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1201,6 +1220,10 @@ public class MainWindow extends JFrame {
|
|||||||
performFileOperation((callback) -> {
|
performFileOperation((callback) -> {
|
||||||
FileOperations.unzip(zipFile, targetDir, callback);
|
FileOperations.unzip(zipFile, targetDir, callback);
|
||||||
}, "Unzipped into " + targetDir.getName(), false, targetPanel);
|
}, "Unzipped into " + targetDir.getName(), false, targetPanel);
|
||||||
|
} else {
|
||||||
|
if (activePanel != null && activePanel.getFileTable() != null) {
|
||||||
|
activePanel.getFileTable().requestFocusInWindow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1230,6 +1253,10 @@ public class MainWindow extends JFrame {
|
|||||||
performFileOperation((callback) -> {
|
performFileOperation((callback) -> {
|
||||||
FileOperations.rename(item.getFile(), newName.trim());
|
FileOperations.rename(item.getFile(), newName.trim());
|
||||||
}, "Rename completed", false, activePanel);
|
}, "Rename completed", false, activePanel);
|
||||||
|
} else {
|
||||||
|
if (activePanel != null && activePanel.getFileTable() != null) {
|
||||||
|
activePanel.getFileTable().requestFocusInWindow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1247,6 +1274,10 @@ public class MainWindow extends JFrame {
|
|||||||
performFileOperation((callback) -> {
|
performFileOperation((callback) -> {
|
||||||
FileOperations.createDirectory(activePanel.getCurrentDirectory(), dirName.trim());
|
FileOperations.createDirectory(activePanel.getCurrentDirectory(), dirName.trim());
|
||||||
}, "Directory created", false, activePanel);
|
}, "Directory created", false, activePanel);
|
||||||
|
} else {
|
||||||
|
if (activePanel != null && activePanel.getFileTable() != null) {
|
||||||
|
activePanel.getFileTable().requestFocusInWindow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1703,8 +1734,14 @@ public class MainWindow extends JFrame {
|
|||||||
panel.loadDirectory(panel.getCurrentDirectory());
|
panel.loadDirectory(panel.getCurrentDirectory());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (activePanel != null && activePanel.getFileTable() != null) {
|
||||||
|
activePanel.getFileTable().requestFocusInWindow();
|
||||||
|
}
|
||||||
if (callback.isCancelled()) {
|
if (callback.isCancelled()) {
|
||||||
JOptionPane.showMessageDialog(MainWindow.this, "Operation was cancelled by user.");
|
JOptionPane.showMessageDialog(MainWindow.this, "Operation was cancelled by user.");
|
||||||
|
if (activePanel != null && activePanel.getFileTable() != null) {
|
||||||
|
activePanel.getFileTable().requestFocusInWindow();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -1714,6 +1751,9 @@ public class MainWindow extends JFrame {
|
|||||||
"Error: " + e.getMessage(),
|
"Error: " + e.getMessage(),
|
||||||
"Error",
|
"Error",
|
||||||
JOptionPane.ERROR_MESSAGE);
|
JOptionPane.ERROR_MESSAGE);
|
||||||
|
if (activePanel != null && activePanel.getFileTable() != null) {
|
||||||
|
activePanel.getFileTable().requestFocusInWindow();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user