Search: when finding metadata objects you can't open them
@@ -37,34 +37,43 @@ public class HopGuiMetadataSearchable implements ISearchable<IHopMetadata> {
private IHopMetadata searchableObject;
private Class<IHopMetadata> managedClass;
- public HopGuiMetadataSearchable( IHopMetadataProvider metadataProvider, IHopMetadataSerializer<IHopMetadata> serializer, IHopMetadata searchableObject, Class<IHopMetadata> managedClass ) {
+ public HopGuiMetadataSearchable(
+ IHopMetadataProvider metadataProvider,
+ IHopMetadataSerializer<IHopMetadata> serializer,
+ IHopMetadata searchableObject,
+ Class<IHopMetadata> managedClass) {
this.metadataProvider = metadataProvider;
this.serializer = serializer;
this.searchableObject = searchableObject;
this.managedClass = managedClass;
}
- @Override public String getLocation() {
+ @Override
+ public String getLocation() {
return metadataProvider.getDescription();
}
- @Override public String getName() {
+ @Override
+ public String getName() {
return searchableObject.getName();
}
- @Override public String getType() {
+ @Override
+ public String getType() {
return serializer.getDescription();
}
- @Override public String getFilename() {
+ @Override
+ public String getFilename() {
return null;
}
- @Override public ISearchableCallback getSearchCallback() {
+ @Override
+ public ISearchableCallback getSearchCallback() {
return (searchable, searchResult) -> {
// Open the metadata object...
//
- new MetadataManager( HopGui.getInstance().getVariables(), HopGui.getInstance().getMetadataProvider(), searchable.getClass() )
+ new MetadataManager(HopGui.getInstance().getVariables(), metadataProvider, managedClass)
.editMetadata(searchable.getName());
};
}
@@ -74,13 +83,12 @@ public class HopGuiMetadataSearchable implements ISearchable<IHopMetadata> {
*
* @return value of searchableObject
*/
- @Override public IHopMetadata getSearchableObject() {
+ @Override
+ public IHopMetadata getSearchableObject() {
return searchableObject;
}
- /**
- * @param searchableObject The searchableObject to set
- */
+ /** @param searchableObject The searchableObject to set */
public void setSearchableObject(IHopMetadata searchableObject) {
this.searchableObject = searchableObject;
}
@@ -94,9 +102,7 @@ public class HopGuiMetadataSearchable implements ISearchable<IHopMetadata> {
return managedClass;
}
- /**
- * @param managedClass The managedClass to set
- */
+ /** @param managedClass The managedClass to set */
public void setManagedClass(Class<IHopMetadata> managedClass) {
this.managedClass = managedClass;
}
