Skip to content

Commit

Permalink
'#1866: Use a standard name listItems() in related items TableModels.
Browse files Browse the repository at this point in the history
  • Loading branch information
wladimirleite committed Sep 6, 2023
1 parent cb85d76 commit cc0804e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
2 changes: 2 additions & 0 deletions iped-app/src/main/java/iped/app/ui/BaseTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
3 changes: 2 additions & 1 deletion iped-app/src/main/java/iped/app/ui/DuplicatesTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
10 changes: 5 additions & 5 deletions iped-app/src/main/java/iped/app/ui/FileProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
3 changes: 2 additions & 1 deletion iped-app/src/main/java/iped/app/ui/ParentTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion iped-app/src/main/java/iped/app/ui/SubitemTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit cc0804e

Please sign in to comment.