From cc0804eb3bfe44eebaab46497758ba7fe1d9dcf8 Mon Sep 17 00:00:00 2001 From: tc-wleite Date: Wed, 6 Sep 2023 10:03:03 -0300 Subject: [PATCH] '#1866: Use a standard name listItems() in related items TableModels. --- iped-app/src/main/java/iped/app/ui/BaseTableModel.java | 2 ++ .../main/java/iped/app/ui/DuplicatesTableModel.java | 3 ++- iped-app/src/main/java/iped/app/ui/FileProcessor.java | 10 +++++----- .../src/main/java/iped/app/ui/ParentTableModel.java | 3 ++- .../main/java/iped/app/ui/ReferencedByTableModel.java | 3 ++- .../main/java/iped/app/ui/ReferencingTableModel.java | 3 ++- .../src/main/java/iped/app/ui/SubitemTableModel.java | 3 ++- 7 files changed, 17 insertions(+), 10 deletions(-) diff --git a/iped-app/src/main/java/iped/app/ui/BaseTableModel.java b/iped-app/src/main/java/iped/app/ui/BaseTableModel.java index 3716dc1e90..653bae4a7a 100644 --- a/iped-app/src/main/java/iped/app/ui/BaseTableModel.java +++ b/iped-app/src/main/java/iped/app/ui/BaseTableModel.java @@ -110,4 +110,6 @@ public void mouseReleased(MouseEvent evt) { public IMultiSearchResult getSearchResult() { return MultiSearchResult.get(App.get().appCase, results); } + + public abstract void listItems(Document doc); } diff --git a/iped-app/src/main/java/iped/app/ui/DuplicatesTableModel.java b/iped-app/src/main/java/iped/app/ui/DuplicatesTableModel.java index bb6e60f1d6..739d90a5be 100644 --- a/iped-app/src/main/java/iped/app/ui/DuplicatesTableModel.java +++ b/iped-app/src/main/java/iped/app/ui/DuplicatesTableModel.java @@ -68,7 +68,8 @@ public void valueChanged(ListSelectionEvent evt) { App.get().parentItemModel.fireTableDataChanged(); } - public void listDuplicates(Document doc) { + @Override + public void listItems(Document doc) { String hash = doc.get(IndexItem.HASH); if (hash == null || hash.trim().isEmpty()) diff --git a/iped-app/src/main/java/iped/app/ui/FileProcessor.java b/iped-app/src/main/java/iped/app/ui/FileProcessor.java index 0ff49e8547..a8cef778be 100644 --- a/iped-app/src/main/java/iped/app/ui/FileProcessor.java +++ b/iped-app/src/main/java/iped/app/ui/FileProcessor.java @@ -180,17 +180,17 @@ private void process() throws InterruptedException { App.get().getViewerController().loadFile(item, viewItem, contentType, highlights); if (listRelated) { - App.get().subItemModel.listSubItems(doc); + App.get().subItemModel.listItems(doc); if (Thread.currentThread().isInterrupted()) { return; } - App.get().parentItemModel.listParents(doc); + App.get().parentItemModel.listItems(doc); - App.get().duplicatesModel.listDuplicates(doc); + App.get().duplicatesModel.listItems(doc); - App.get().referencedByModel.listReferencingItems(doc); + App.get().referencedByModel.listItems(doc); - App.get().referencesModel.listReferencingItems(doc); + App.get().referencesModel.listItems(doc); } } diff --git a/iped-app/src/main/java/iped/app/ui/ParentTableModel.java b/iped-app/src/main/java/iped/app/ui/ParentTableModel.java index 41f327d949..ca8485a1f6 100644 --- a/iped-app/src/main/java/iped/app/ui/ParentTableModel.java +++ b/iped-app/src/main/java/iped/app/ui/ParentTableModel.java @@ -53,7 +53,8 @@ public void valueChanged(ListSelectionEvent evt) { App.get().subItemModel.fireTableDataChanged(); } - public void listParents(final Document doc) { + @Override + public void listItems(Document doc) { String textQuery = null; String parentId = doc.get(IndexItem.PARENTID); diff --git a/iped-app/src/main/java/iped/app/ui/ReferencedByTableModel.java b/iped-app/src/main/java/iped/app/ui/ReferencedByTableModel.java index b8418b705c..c25b92d5df 100644 --- a/iped-app/src/main/java/iped/app/ui/ReferencedByTableModel.java +++ b/iped-app/src/main/java/iped/app/ui/ReferencedByTableModel.java @@ -77,7 +77,8 @@ public void valueChanged(ListSelectionEvent evt) { parsingTask.execute(); } - public void listReferencingItems(Document doc) { + @Override + public void listItems(Document doc) { String md5 = doc.get(HashTask.HASH.MD5.toString()); String sha1 = doc.get(HashTask.HASH.SHA1.toString()); diff --git a/iped-app/src/main/java/iped/app/ui/ReferencingTableModel.java b/iped-app/src/main/java/iped/app/ui/ReferencingTableModel.java index 0707c4d6ff..7fbeb64307 100644 --- a/iped-app/src/main/java/iped/app/ui/ReferencingTableModel.java +++ b/iped-app/src/main/java/iped/app/ui/ReferencingTableModel.java @@ -59,7 +59,8 @@ public void valueChanged(ListSelectionEvent evt) { parsingTask.execute(); } - public void listReferencingItems(Document doc) { + @Override + public void listItems(Document doc) { // clear table, searching for refs can take some time if they are thousands results = new LuceneSearchResult(0); diff --git a/iped-app/src/main/java/iped/app/ui/SubitemTableModel.java b/iped-app/src/main/java/iped/app/ui/SubitemTableModel.java index 399853abdc..59040139f5 100644 --- a/iped-app/src/main/java/iped/app/ui/SubitemTableModel.java +++ b/iped-app/src/main/java/iped/app/ui/SubitemTableModel.java @@ -55,7 +55,8 @@ public void valueChanged(ListSelectionEvent evt) { App.get().parentItemModel.fireTableDataChanged(); } - public void listSubItems(Document doc) { + @Override + public void listItems(Document doc) { String parentId = doc.get(IndexItem.ID);