mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Format keywordsearch/HighlightedText.java
This commit is contained in:
parent
681f2da55d
commit
3d4d83e239
@ -253,7 +253,7 @@ class HighlightedText implements IndexedText {
|
|||||||
@Override
|
@Override
|
||||||
public int nextPage() {
|
public int nextPage() {
|
||||||
if (hasNextPage()) {
|
if (hasNextPage()) {
|
||||||
currentPage = Iterators.get(pages.iterator(),getIndexOfCurrentPage() + 1);
|
currentPage = Iterators.get(pages.iterator(), getIndexOfCurrentPage() + 1);
|
||||||
return currentPage;
|
return currentPage;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("No next page.");
|
throw new IllegalStateException("No next page.");
|
||||||
@ -263,7 +263,7 @@ class HighlightedText implements IndexedText {
|
|||||||
@Override
|
@Override
|
||||||
public int previousPage() {
|
public int previousPage() {
|
||||||
if (hasPreviousPage()) {
|
if (hasPreviousPage()) {
|
||||||
currentPage = Iterators.get(pages.iterator(),getIndexOfCurrentPage()-1);
|
currentPage = Iterators.get(pages.iterator(), getIndexOfCurrentPage() - 1);
|
||||||
return currentPage;
|
return currentPage;
|
||||||
} else {
|
} else {
|
||||||
throw new IllegalStateException("No previous page.");
|
throw new IllegalStateException("No previous page.");
|
||||||
@ -462,15 +462,15 @@ class HighlightedText implements IndexedText {
|
|||||||
|
|
||||||
// Advance the text offset past the keyword.
|
// Advance the text offset past the keyword.
|
||||||
textOffset = hitOffset + escapedKeyword.length();
|
textOffset = hitOffset + escapedKeyword.length();
|
||||||
|
|
||||||
hitOffset = StringUtils.indexOfIgnoreCase(text, escapedKeyword, textOffset);
|
hitOffset = StringUtils.indexOfIgnoreCase(text, escapedKeyword, textOffset);
|
||||||
}
|
}
|
||||||
// Append the remainder of text field
|
// Append the remainder of text field
|
||||||
highlightedText.append(text.substring(textOffset, text.length()));
|
highlightedText.append(text.substring(textOffset, text.length()));
|
||||||
|
|
||||||
if (highlightedText.length() == 0) {
|
if (highlightedText.length() == 0) {
|
||||||
return NbBundle.getMessage(HighlightedText.class, "HighlightedMatchesSource.getMarkup.noMatchMsg");
|
return NbBundle.getMessage(HighlightedText.class, "HighlightedMatchesSource.getMarkup.noMatchMsg");
|
||||||
}
|
}
|
||||||
//reset for next pass
|
//reset for next pass
|
||||||
text = highlightedText.toString();
|
text = highlightedText.toString();
|
||||||
highlightedText = new StringBuilder("");
|
highlightedText = new StringBuilder("");
|
||||||
@ -494,7 +494,7 @@ class HighlightedText implements IndexedText {
|
|||||||
final String insertPost = "'></a>"; //NON-NLS
|
final String insertPost = "'></a>"; //NON-NLS
|
||||||
int count = 0;
|
int count = 0;
|
||||||
int searchOffset = 0;
|
int searchOffset = 0;
|
||||||
int index = buf.indexOf(searchToken, searchOffset);
|
int index = buf.indexOf(searchToken, searchOffset);
|
||||||
while (index >= 0) {
|
while (index >= 0) {
|
||||||
String insertString = insertPre + Integer.toString(count + 1) + insertPost;
|
String insertString = insertPre + Integer.toString(count + 1) + insertPost;
|
||||||
int insertStringLen = insertString.length();
|
int insertStringLen = insertString.length();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user