mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-15 01:07:42 +00:00
2969: update the Messages by using classname.messeges format
This commit is contained in:
parent
9f637c8be4
commit
a9caa22141
@ -204,8 +204,8 @@ class DateSearchFilter extends AbstractFileSearchFilter<DateSearchPanel> {
|
||||
|
||||
@Override
|
||||
@Messages ({
|
||||
"End.date.before.start.date=The end date should be after the start date.",
|
||||
"No.checkbox.selected=Non of the date search checkbox is selected."
|
||||
"DateSearchFilter.endDateBeforeStartDate=The end date should be after the start date.",
|
||||
"DateSearchFilter.noCheckboxSelected=Non of the date search checkbox is selected."
|
||||
})
|
||||
public boolean isValid() {
|
||||
|
||||
@ -214,12 +214,12 @@ class DateSearchFilter extends AbstractFileSearchFilter<DateSearchPanel> {
|
||||
Calendar endDate = getCalendarDate(panel.getDateToTextField().getText());
|
||||
|
||||
if ((startDate != null && startDate.after(endDate)) || (endDate != null && endDate.before(startDate))) {
|
||||
setLastError(Bundle.End_date_before_start_date());
|
||||
setLastError(Bundle.DateSearchFilter_endDateBeforeStartDate());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!panel.isValidSearch()) {
|
||||
setLastError(Bundle.No_checkbox_selected());
|
||||
setLastError(Bundle.DateSearchFilter_noCheckboxSelected());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -62,22 +62,22 @@ class HashSearchFilter extends AbstractFileSearchFilter<HashSearchPanel> {
|
||||
|
||||
@Override
|
||||
@Messages({
|
||||
"Empty.hash=Hash data is empty.",
|
||||
"# {0} - hash data length", "Wrong.length=Input lenght({0}), doesn't match the MD5 length(32).",
|
||||
"Wrong.character=Input data is an invalid MD5 hex data."
|
||||
"HashSearchFilter.emptyHash=Hash data is empty.",
|
||||
"# {0} - hash data length", "HashSearchFilter.wrongLength=Input lenght({0}), doesn't match the MD5 length(32).",
|
||||
"HashSearchFilter.wrongCharacter=Input data is an invalid MD5 hex data."
|
||||
})
|
||||
public boolean isValid() {
|
||||
String inputHashData = this.getComponent().getSearchTextField().getText();
|
||||
if (inputHashData.isEmpty()) {
|
||||
setLastError(Bundle.Empty_hash());
|
||||
setLastError(Bundle.HashSearchFilter_emptyHash());
|
||||
return false;
|
||||
}
|
||||
if (inputHashData.length() != 32) {
|
||||
setLastError(Bundle.Wrong_length(inputHashData.length()));
|
||||
setLastError(Bundle.HashSearchFilter_wrongLength(inputHashData.length()));
|
||||
return false;
|
||||
}
|
||||
if (!inputHashData.matches("[0-9a-fA-F]+")) {
|
||||
setLastError(Bundle.Wrong_character());
|
||||
setLastError(Bundle.HashSearchFilter_wrongCharacter());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -76,8 +76,8 @@ class SizeSearchFilter extends AbstractFileSearchFilter<SizeSearchPanel> {
|
||||
|
||||
@Override
|
||||
@Messages ({
|
||||
"Non.negative.number=Input size data is a negative number.",
|
||||
"Not.a.number=Input size data is not a number."
|
||||
"SizeSearchFilter.nonNegativeNumber=Input size data is a negative number.",
|
||||
"SizeSearchFilter.notANumber=Input size data is not a number."
|
||||
})
|
||||
public boolean isValid() {
|
||||
String input = this.getComponent().getSizeTextField().getText();
|
||||
@ -85,11 +85,11 @@ class SizeSearchFilter extends AbstractFileSearchFilter<SizeSearchPanel> {
|
||||
try {
|
||||
int inputInt = Integer.parseInt(input);
|
||||
if (inputInt < 0) {
|
||||
setLastError(Bundle.Non_negative_number());
|
||||
setLastError(Bundle.SizeSearchFilter_nonNegativeNumber());
|
||||
return false;
|
||||
}
|
||||
} catch (NumberFormatException | NullPointerException e) {
|
||||
setLastError(Bundle.Not_a_number());
|
||||
setLastError(Bundle.SizeSearchFilter_notANumber());
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user