19 package org.sleuthkit.autopsy.datamodel;
21 import java.beans.PropertyChangeEvent;
22 import java.beans.PropertyChangeListener;
23 import org.openide.nodes.Children;
24 import org.openide.nodes.Sheet;
25 import org.openide.util.Lookup;
26 import org.openide.util.NbBundle;
46 "TagNode.propertySheet.origName=Original Name",
47 "TagNode.propertySheet.origNameDisplayName=Original Name"
49 abstract class TagNode extends DisplayableItemNode {
51 private final static String ORIG_NAME_PROP_NAME = Bundle.TagNode_propertySheet_origName();
52 private final static String ORIG_NAME_PROP_DISPLAY_NAME = Bundle.TagNode_propertySheet_origNameDisplayName();
54 private final String originalName;
55 private volatile String translatedName;
65 TagNode(Lookup lookup, Content content) {
66 super(Children.LEAF, lookup);
67 originalName = content.getName();
71 public boolean isLeafTypeNode() {
76 abstract public String getItemType();
79 abstract public <T> T accept(DisplayableItemNodeVisitor<T> visitor);
92 protected void addOriginalNameProp(Sheet.Set properties) {
93 if (TextTranslationService.getInstance().hasProvider() && UserPreferences.displayTranslatedFileNames()) {
94 properties.put(
new NodeProperty<>(
96 ORIG_NAME_PROP_DISPLAY_NAME,
98 translatedName != null ? originalName :
""));
99 if (translatedName == null) {
100 new FileNameTransTask(originalName,
this,
new NameTranslationListener()).submit();
113 String eventType = evt.getPropertyName();
115 translatedName = evt.getNewValue().toString();
116 String originalName = evt.getOldValue().toString();
117 setDisplayName(translatedName);
118 setShortDescription(originalName);
121 ORIG_NAME_PROP_DISPLAY_NAME,
static String getPropertyName()
void propertyChange(PropertyChangeEvent evt)