mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
convert filters package to NBundle.Messages annotation
This commit is contained in:
parent
a95eb009ae
commit
e4b095681b
@ -377,7 +377,6 @@ public class TimeLineController {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private long getCaseLastArtifactID(final SleuthkitCase sleuthkitCase) {
|
||||
long caseLastArtfId = -1;
|
||||
String query = "select Max(artifact_id) as max_id from blackboard_artifacts"; // NON-NLS
|
||||
|
@ -1,4 +0,0 @@
|
||||
hideKnownFilter.displayName.text=Hide Known Files
|
||||
IntersectionFilter.displayName.text=Intersection{0}
|
||||
TextFilter.displayName.text=Text Filter
|
||||
TypeFilter.displayName.text=Event Type Filter
|
@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.timeline.filters;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import org.openide.util.NbBundle;
|
||||
|
||||
/**
|
||||
* union of {@link DataSourceFilter}s
|
||||
@ -44,8 +45,9 @@ public class DataSourcesFilter extends UnionFilter<DataSourceFilter> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NbBundle.Messages("DataSourcesFilter.displayName.text=Data Source")
|
||||
public String getDisplayName() {
|
||||
return "Data Source";
|
||||
return Bundle.DataSourcesFilter_displayName_text();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -53,7 +55,10 @@ public class DataSourcesFilter extends UnionFilter<DataSourceFilter> {
|
||||
//move this logic into SaveSnapshot
|
||||
String string = getDisplayName() + getStringCheckBox();
|
||||
if (getSubFilters().isEmpty() == false) {
|
||||
string = string + " : " + getSubFilters().stream().filter(Filter::isSelected).map(Filter::getHTMLReportString).collect(Collectors.joining("</li><li>", "<ul><li>", "</li></ul>")); // NON-NLS
|
||||
string = string + " : " + getSubFilters().stream()
|
||||
.filter(Filter::isSelected)
|
||||
.map(Filter::getHTMLReportString)
|
||||
.collect(Collectors.joining("</li><li>", "<ul><li>", "</li></ul>")); // NON-NLS
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
@ -26,8 +26,9 @@ import org.openide.util.NbBundle;
|
||||
public class HideKnownFilter extends AbstractFilter {
|
||||
|
||||
@Override
|
||||
@NbBundle.Messages("hideKnownFilter.displayName.text=Hide Known Files")
|
||||
public String getDisplayName() {
|
||||
return NbBundle.getMessage(this.getClass(), "hideKnownFilter.displayName.text");
|
||||
return Bundle.hideKnownFilter_displayName_text();
|
||||
}
|
||||
|
||||
public HideKnownFilter() {
|
||||
|
@ -47,12 +47,13 @@ public class IntersectionFilter<S extends Filter> extends CompoundFilter<S> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NbBundle.Messages({"# {0} - sub filter displaynames",
|
||||
"IntersectionFilter.displayName.text=Intersection{0}"})
|
||||
public String getDisplayName() {
|
||||
return NbBundle.getMessage(this.getClass(),
|
||||
"IntersectionFilter.displayName.text",
|
||||
getSubFilters().stream()
|
||||
String collect = getSubFilters().stream()
|
||||
.map(Filter::getDisplayName)
|
||||
.collect(Collectors.joining(",", "[", "]")));
|
||||
.collect(Collectors.joining(",", "[", "]"));
|
||||
return Bundle.IntersectionFilter_displayName_text(collect);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,33 +26,34 @@ import org.openide.util.NbBundle;
|
||||
|
||||
/** Filter for text matching */
|
||||
public class TextFilter extends AbstractFilter {
|
||||
|
||||
|
||||
public TextFilter() {
|
||||
}
|
||||
|
||||
|
||||
public TextFilter(String text) {
|
||||
this.text.set(text);
|
||||
}
|
||||
|
||||
|
||||
private final SimpleStringProperty text = new SimpleStringProperty();
|
||||
|
||||
|
||||
synchronized public void setText(String text) {
|
||||
this.text.set(text);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@NbBundle.Messages("TextFilter.displayName.text=Text Filter")
|
||||
public String getDisplayName() {
|
||||
return NbBundle.getMessage(this.getClass(), "TextFilter.displayName.text");
|
||||
return Bundle.TextFilter_displayName_text();
|
||||
}
|
||||
|
||||
|
||||
synchronized public String getText() {
|
||||
return text.getValue();
|
||||
}
|
||||
|
||||
|
||||
public Property<String> textProperty() {
|
||||
return text;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
synchronized public TextFilter copyOf() {
|
||||
TextFilter textFilter = new TextFilter(getText());
|
||||
@ -60,12 +61,12 @@ public class TextFilter extends AbstractFilter {
|
||||
textFilter.setDisabled(isDisabled());
|
||||
return textFilter;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getHTMLReportString() {
|
||||
return "text like \"" + StringUtils.defaultIfBlank(text.getValue(), "") + "\"" + getStringCheckBox(); // NON-NLS
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
@ -75,18 +76,18 @@ public class TextFilter extends AbstractFilter {
|
||||
return false;
|
||||
}
|
||||
final TextFilter other = (TextFilter) obj;
|
||||
|
||||
|
||||
if (isSelected() != other.isSelected()) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(text.get(), other.text.get());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 5;
|
||||
hash = 29 * hash + Objects.hashCode(this.text.get());
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -64,12 +64,11 @@ public class TypeFilter extends UnionFilter<TypeFilter> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@NbBundle.Messages("TypeFilter.displayName.text=Event Type Filter")
|
||||
public String getDisplayName() {
|
||||
if (eventType == RootEventType.getInstance()) {
|
||||
return NbBundle.getMessage(this.getClass(), "TypeFilter.displayName.text");
|
||||
} else {
|
||||
return eventType.getDisplayName();
|
||||
}
|
||||
return (eventType == RootEventType.getInstance())
|
||||
? Bundle.TypeFilter_displayName_text()
|
||||
: eventType.getDisplayName();
|
||||
}
|
||||
|
||||
/** @return a color to use in GUI components representing this filter */
|
||||
|
Loading…
x
Reference in New Issue
Block a user