Autopsy  4.4.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
TextFilter.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2013-15 Basis Technology Corp.
5  * Contact: carrier <at> sleuthkit <dot> org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19 package org.sleuthkit.autopsy.timeline.filters;
20 
21 import java.util.Objects;
22 import javafx.beans.property.Property;
23 import javafx.beans.property.SimpleStringProperty;
24 import org.openide.util.NbBundle;
25 
29 public class TextFilter extends AbstractFilter {
30 
31  public TextFilter() {
32  }
33 
34  public TextFilter(String text) {
35  this.text.set(text);
36  }
37 
38  private final SimpleStringProperty text = new SimpleStringProperty();
39 
40  synchronized public void setText(String text) {
41  this.text.set(text);
42  }
43 
44  @Override
45  @NbBundle.Messages("TextFilter.displayName.text=Text Filter")
46  public String getDisplayName() {
47  return Bundle.TextFilter_displayName_text();
48  }
49 
50  synchronized public String getText() {
51  return text.getValue();
52  }
53 
54  public Property<String> textProperty() {
55  return text;
56  }
57 
58  @Override
59  synchronized public TextFilter copyOf() {
60  TextFilter textFilter = new TextFilter(getText());
61  textFilter.setSelected(isSelected());
62  textFilter.setDisabled(isDisabled());
63  return textFilter;
64  }
65 
66  @Override
67  public boolean equals(Object obj) {
68  if (obj == null) {
69  return false;
70  }
71  if (getClass() != obj.getClass()) {
72  return false;
73  }
74  final TextFilter other = (TextFilter) obj;
75 
76  if (isSelected() != other.isSelected()) {
77  return false;
78  }
79  return Objects.equals(text.get(), other.text.get());
80  }
81 
82  @Override
83  public int hashCode() {
84  int hash = 5;
85  hash = 29 * hash + Objects.hashCode(this.text.get());
86  return hash;
87  }
88 }
synchronized void setText(String text)
Definition: TextFilter.java:40

Copyright © 2012-2016 Basis Technology. Generated on: Fri Sep 29 2017
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.