Skip to content

Commit

Permalink
pcorlessGH-216 Gives filtered pages indexes to documentFilterCompleted
Browse files Browse the repository at this point in the history
  • Loading branch information
gtache committed Nov 7, 2022
1 parent d783814 commit 6e1eace
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
8 changes: 8 additions & 0 deletions core/core-awt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
</plugins>
</build>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5614,7 +5614,8 @@ public void documentFilterStarted(final DocumentFilter filter, final Document do
}

@Override
public void documentFilterEnded(final DocumentFilter filter, final Document document) {
public void documentFilterCompleted(final DocumentFilter filter, final Document document,
final Set<Integer> filteredPages) {
if (this.document == document) {
setEnabled(filterPagesButton, !isPdfCollection() && document != null && areFiltersReady());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Set<Integer> filterPages(final Document document) {
listeners.forEach(l -> l.documentFilterStarted(this, document));
final Set<Integer> filtered = filterPagesUncached(document);
cache.put(document, filtered);
listeners.forEach(l -> l.documentFilterEnded(this, document));
listeners.forEach(l -> l.documentFilterCompleted(this, document, filtered));
return filtered;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import org.icepdf.core.pobjects.Document;

import java.util.Set;

/**
* Represents a listener of DocumentFilter
*/
Expand All @@ -17,8 +19,9 @@ public interface DocumentFilterListener {
/**
* Sent when a filtering has ended
*
* @param filter The filter
* @param document The document the filter has finished filtering
* @param filter The filter
* @param document The document the filter has finished filtering
* @param filteredPages The indexes of the pages that passed the filter
*/
void documentFilterEnded(final DocumentFilter filter, final Document document);
void documentFilterCompleted(final DocumentFilter filter, final Document document, final Set<Integer> filteredPages);
}

0 comments on commit 6e1eace

Please sign in to comment.