Interface PropertySuggestionSourceRegistry
- 
- All Known Implementing Classes:
- PropertySuggestionSourceRegistryImpl
 
 public interface PropertySuggestionSourceRegistryRegistry for dynamic suggestion sources for perspective component properties. This system allows 3rd parties to register SuggestionSourceimplementations and then mark component properties using the JSON-schema to use that suggestion source. The end result being that in the Designer, the property will have a dropdown displayed in the editor that allows the user to pick from the suggested values.To use this system, perform the following two steps: - 
         Annotate the property in question in your JSON schema using the "suggestion-source" extension. For example:
         "myProperty": { "type": "string", "default": "foo", "description": "This property will have dynamic suggestions", "extension": { "suggestion-source": "my-suggestion-source-key" } }
- 
         Register your suggestion source implementation using the matching key from the schema. This will probably
         be done in your designer hook's startup method. For exmaple:
         PerspectiveDesignerInterface perspectiveDesigner = PerspectiveDesignerInterface.get(designerContext); perspectiveDesigner.getSuggestionSourceRegistry().registerSuggestionSource( "my-suggestion-source-key", (node, schema) -> CompletableFuture.completedFuture(loadSuggestions()) );
 
- 
- 
Field SummaryFields Modifier and Type Field Description static java.lang.StringSUGGESTION_EXTENSION
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<SuggestionSource>findSuggestionSource(java.lang.String key)static PropertySuggestionSourceRegistryget(DesignerContext context)voidregisterSuggestionSource(java.lang.String key, SuggestionSource source)
 
- 
- 
- 
Field Detail- 
SUGGESTION_EXTENSIONstatic final java.lang.String SUGGESTION_EXTENSION - See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
getstatic PropertySuggestionSourceRegistry get(DesignerContext context) 
 - 
registerSuggestionSourcevoid registerSuggestionSource(java.lang.String key, SuggestionSource source)
 - 
findSuggestionSourcejava.util.Optional<SuggestionSource> findSuggestionSource(java.lang.String key) 
 
- 
 
-