Package io.jmix.dynmodelflowui.impl
Class DynamicViewHandlerSuggestionProvider
java.lang.Object
io.jmix.dynmodelflowui.impl.DynamicViewHandlerSuggestionProvider
@Component("dynmod_DynamicViewHandlerSuggestionProvider")
public class DynamicViewHandlerSuggestionProvider
extends Object
Provides code completion for a dynamic view behavior handler expression, in the role
JpqlUiSuggestionProvider plays for JPQL queries. Used by the Admin UI handler editor as the
Suggester of its expression editor.
What is offered depends on where the cursor stands, as classified by
DynamicViewHandlerExpressionParser: the sandbox API at the root and after a dot, and the
values valid in the slot when the cursor is inside a string argument — component ids for the
components facade, operation names for services.call, and the view's handler names
for the follow-up of dialogs.confirm. Keys of the state facade are invented by the
expression author, so nothing is offered for them.
The typed prefix is not filtered here; the code editor filters the returned options client-side, the same way it does for JPQL.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordWhat the editor knows about the handler being edited and cannot be derived from the expression. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DynamicViewApiIntrospectorprotected static final Stringprotected static final Stringprotected static final intThe argument ofdialogs.confirm(header, text, handlerName)that names the follow-up handler.protected static final Stringprotected static final Stringprotected static final Stringprotected DynamicViewEntityAttributeProviderprotected DynamicModelOperationRegistryprotected DynamicViewHandlerExpressionParserprotected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<Suggestion> argumentSuggestions(DynamicViewHandlerExpressionParser.Position position, DynamicViewHandlerSuggestionProvider.EditorContext editorContext) protected List<Suggestion> The XML tag is shown as the hint, as in the component id combo of the same dialog.entityPath(String receiverPath) getSuggestions(Suggester.SuggestionContext context, DynamicViewHandlerSuggestionProvider.EditorContext editorContext) Returns the suggestions for the current editor state.protected List<Suggestion> handlerNameSuggestions(List<String> handlerNames) protected List<Suggestion> memberSuggestions(String receiverPath, DynamicViewHandlerSuggestionProvider.EditorContext editorContext) protected List<Suggestion> protected StringparameterTypes(Method method) protected List<Suggestion> The entity andisNew()alongside the facade names.protected List<Suggestion> suggest(Suggester.SuggestionContext context, DynamicViewHandlerSuggestionProvider.EditorContext editorContext)
-
Field Details
-
ENTITY_MEMBER
- See Also:
-
COMPONENTS_FACADE
- See Also:
-
SERVICES_FACADE
- See Also:
-
DIALOGS_FACADE
- See Also:
-
CALL_METHOD
- See Also:
-
CONFIRM_METHOD
- See Also:
-
CONFIRM_HANDLER_ARGUMENT
protected static final int CONFIRM_HANDLER_ARGUMENTThe argument ofdialogs.confirm(header, text, handlerName)that names the follow-up handler.- See Also:
-
parser
-
apiIntrospector
-
entityAttributeProvider
-
operationRegistry
-
-
Constructor Details
-
DynamicViewHandlerSuggestionProvider
public DynamicViewHandlerSuggestionProvider()
-
-
Method Details
-
getSuggestions
public List<Suggestion> getSuggestions(Suggester.SuggestionContext context, DynamicViewHandlerSuggestionProvider.EditorContext editorContext) Returns the suggestions for the current editor state. Never throws: the code runs on every keystroke that opens the popup, and an empty list only leaves the editor without suggestions.- Parameters:
context- the current state of the client-side of the editoreditorContext- what the editor knows about the handler being edited
-
suggest
protected List<Suggestion> suggest(Suggester.SuggestionContext context, DynamicViewHandlerSuggestionProvider.EditorContext editorContext) -
rootSuggestions
protected List<Suggestion> rootSuggestions(DynamicViewHandlerSuggestionProvider.EditorContext editorContext) The entity andisNew()alongside the facade names. The entity is reported with the name of the entity it holds rather than as a plain object, which is all the sandbox API can tell. -
memberSuggestions
protected List<Suggestion> memberSuggestions(String receiverPath, DynamicViewHandlerSuggestionProvider.EditorContext editorContext) -
entityPath
- Returns:
- the reference attributes traversed after
entity, ornullwhen the path does not start at the entity
-
argumentSuggestions
protected List<Suggestion> argumentSuggestions(DynamicViewHandlerExpressionParser.Position position, DynamicViewHandlerSuggestionProvider.EditorContext editorContext) -
componentSuggestions
protected List<Suggestion> componentSuggestions(List<DynamicViewComponentIdProvider.ComponentInfo> components) The XML tag is shown as the hint, as in the component id combo of the same dialog. -
operationSuggestions
-
parameterTypes
-
handlerNameSuggestions
-