more fiddling

This commit is contained in:
Brian Sweeney
2018-06-26 10:59:55 -06:00
parent 7af4bfb880
commit 52d13face4
3 changed files with 59 additions and 52 deletions
@@ -76,15 +76,16 @@ public class FileInstanceNode extends FileNode {
}
Map<String, Object> map = new LinkedHashMap<>();
fillPropertyMap(map, this);
//fillPropertyMap(map, this);
final String NO_DESCR = Bundle.FileInstanceNode_createSheet_noDescription();
for (CommonFilePropertyType propType : CommonFilePropertyType.values()) {
final String propString = propType.toString();
final Object property = map.get(propString);
final NodeProperty<Object> nodeProperty = new NodeProperty<>(propString, propString, NO_DESCR, property);
sheetSet.put(nodeProperty);
}
sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_filesColLbl(), Bundle.CommonFilesSearchResultsViewerTable_filesColLbl(), NO_DESCR, this.getContent().getName()));
sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), NO_DESCR, ""));
sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_pathColLbl(), Bundle.CommonFilesSearchResultsViewerTable_pathColLbl(), NO_DESCR, this.getContent().getParentPath()));
sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_hashsetHitsColLbl(), Bundle.CommonFilesSearchResultsViewerTable_hashsetHitsColLbl(), NO_DESCR, getHashSetHitsForFile(this.getContent())));
sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), NO_DESCR, this.getDataSource()));
sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_mimeTypeColLbl(), Bundle.CommonFilesSearchResultsViewerTable_mimeTypeColLbl(), NO_DESCR, StringUtils.defaultString(this.getContent().getMIMEType())));
this.addTagProperty(sheetSet);
@@ -103,14 +103,17 @@ final public class InstanceCountNode extends DisplayableItemNode {
sheet.put(sheetSet);
}
Map<String, Object> map = new LinkedHashMap<>();
fillPropertyMap(map, this);
//Map<String, Object> map = new LinkedHashMap<>();
//fillPropertyMap(map, this);
final String NO_DESCR = Bundle.InstanceCountNode_createSheet_noDescription();
for (InstanceCountNode.InstanceCountNodePropertyType propType : InstanceCountNode.InstanceCountNodePropertyType.values()) {
final String propString = propType.toString();
sheetSet.put(new NodeProperty<>(propString, propString, NO_DESCR, map.get(propString)));
}
sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), NO_DESCR, this.getInstanceCount()));
// for (InstanceCountNode.InstanceCountNodePropertyType propType : InstanceCountNode.InstanceCountNodePropertyType.values()) {
// final String propString = propType.toString();
// sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), NO_DESCR, this.getInstanceCount()));
// }
return sheet;
}
@@ -105,15 +105,18 @@ public class Md5Node extends DisplayableItemNode {
sheetSet = Sheet.createPropertiesSet();
sheet.put(sheetSet);
}
Map<String, Object> map = new LinkedHashMap<>();
fillPropertyMap(map, this);
//
// Map<String, Object> map = new LinkedHashMap<>();
//fillPropertyMap(map, this);
final String NO_DESCR = Bundle.Md5Node_createSheet_noDescription();
for (Md5Node.CommonFileParentPropertyType propType : Md5Node.CommonFileParentPropertyType.values()) {
final String propString = propType.toString();
sheetSet.put(new NodeProperty<>(propString, propString, NO_DESCR, map.get(propString)));
}
sheetSet.put(new NodeProperty<>(Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), NO_DESCR, this.getDataSources()));
// for (Md5Node.CommonFileParentPropertyType propType : Md5Node.CommonFileParentPropertyType.values()) {
// final String propString = propType.toString();
// sheetSet.put(new NodeProperty<>(propString, propString, NO_DESCR, map.get(propString)));
// }
return sheet;
}
@@ -125,16 +128,16 @@ public class Md5Node extends DisplayableItemNode {
* put
* @param node The item to get properties for.
*/
static private void fillPropertyMap(Map<String, Object> map, Md5Node node) {
//map.put(CommonFileParentPropertyType.Files.toString(), "");
//map.put(CommonFileParentPropertyType.Instances.toString(), "");
//map.put(CommonFileParentPropertyType.ParentPath.toString(), "");
//map.put(CommonFileParentPropertyType.HashsetHits.toString(), "");
map.put(CommonFileParentPropertyType.DataSource.toString(), node.getDataSources());
//map.put(CommonFileParentPropertyType.MimeType.toString(), "");
//map.put(CommonFileParentPropertyType.Tags.toString(), "");
}
// static private void fillPropertyMap(Map<String, Object> map, Md5Node node) {
//
// //map.put(CommonFileParentPropertyType.Files.toString(), "");
// //map.put(CommonFileParentPropertyType.Instances.toString(), "");
// //map.put(CommonFileParentPropertyType.ParentPath.toString(), "");
// //map.put(CommonFileParentPropertyType.HashsetHits.toString(), "");
// map.put(CommonFileParentPropertyType.DataSource.toString(), node.getDataSources());
// //map.put(CommonFileParentPropertyType.MimeType.toString(), "");
// //map.put(CommonFileParentPropertyType.Tags.toString(), "");
// }
@Override
public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
@@ -183,25 +186,25 @@ public class Md5Node extends DisplayableItemNode {
}
}
public enum CommonFileParentPropertyType {
//Files(Bundle.CommonFileParentPropertyType_filesColLbl1()),
//Instances(Bundle.CommonFilesParentPropertyType_instancesColLbl1()),
//ParentPath(Bundle.CommonFileParentPropertyType_parentPathColLbl()),
//HashSetHits(Bundle.CommonFileParentPropertyType_hashSetHitsColLbl1()),
DataSource(Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl()),
//MimeType(Bundle.CommonFilePropertyType_mimeTypeColLbl1())
;
final private String displayString;
private CommonFileParentPropertyType(String displayString) {
this.displayString = displayString;
}
@Override
public String toString() {
return this.displayString;
}
}
}
// public enum CommonFileParentPropertyType {
//
// //Files(Bundle.CommonFileParentPropertyType_filesColLbl1()),
// //Instances(Bundle.CommonFilesParentPropertyType_instancesColLbl1()),
// //ParentPath(Bundle.CommonFileParentPropertyType_parentPathColLbl()),
// //HashSetHits(Bundle.CommonFileParentPropertyType_hashSetHitsColLbl1()),
// DataSource(Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl()),
// //MimeType(Bundle.CommonFilePropertyType_mimeTypeColLbl1())
// ;
//
// final private String displayString;
//
// private CommonFileParentPropertyType(String displayString) {
// this.displayString = displayString;
// }
//
// @Override
// public String toString() {
// return this.displayString;
// }
// }
}