mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-20 08:46:56 +00:00
UI thread invoke fixes/improvements
This commit is contained in:
@@ -87,6 +87,8 @@ public class SearchPanel<E> extends JPanel {
|
||||
}
|
||||
|
||||
public boolean setResults(List<E> results) {
|
||||
View.checkAccess();
|
||||
|
||||
found = results;
|
||||
if (found.isEmpty()) {
|
||||
setVisible(false);
|
||||
@@ -104,20 +106,24 @@ public class SearchPanel<E> extends JPanel {
|
||||
}
|
||||
|
||||
public void setPos(int pos) {
|
||||
View.checkAccess();
|
||||
|
||||
foundPos = pos;
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
View.checkAccess();
|
||||
|
||||
foundPos = 0;
|
||||
found.clear();
|
||||
}
|
||||
|
||||
private void doUpdate() {
|
||||
View.execInEventDispatchLater(() -> {
|
||||
searchPos.setText((foundPos + 1) + "/" + found.size());
|
||||
listener.updateSearchPos(found.get(foundPos));
|
||||
});
|
||||
View.checkAccess();
|
||||
|
||||
searchPos.setText((foundPos + 1) + "/" + found.size());
|
||||
listener.updateSearchPos(found.get(foundPos));
|
||||
}
|
||||
|
||||
private void cancelButtonActionPerformed(ActionEvent evt) {
|
||||
|
||||
Reference in New Issue
Block a user