use of io.jmix.ui.screen.Install in project jmix by jmix-framework.
the class UiControllerReflectionInspector method getAnnotatedInstallMethodsNotCached.
protected List<AnnotatedMethod<Install>> getAnnotatedInstallMethodsNotCached(@SuppressWarnings("unused") Class<?> clazz, Method[] uniqueDeclaredMethods) {
MethodHandles.Lookup lookup = MethodHandles.lookup();
List<AnnotatedMethod<Install>> annotatedMethods = new ArrayList<>();
for (Method m : uniqueDeclaredMethods) {
Install installAnnotation = findMergedAnnotation(m, Install.class);
if (installAnnotation != null) {
if (!m.isAccessible()) {
m.setAccessible(true);
}
MethodHandle methodHandle;
try {
methodHandle = lookup.unreflect(m);
} catch (IllegalAccessException e) {
throw new RuntimeException("unable to get method handle " + m);
}
annotatedMethods.add(new AnnotatedMethod<>(installAnnotation, m, methodHandle));
}
}
return ImmutableList.copyOf(annotatedMethods);
}
use of io.jmix.ui.screen.Install in project jmix by jmix-framework.
the class DlcBaseTestScreen method ownersDlLoadDelegate.
@Install(to = "ownersDl", target = Target.DATA_LOADER)
private List<Owner> ownersDlLoadDelegate(LoadContext<Owner> loadContext) {
events.add(new LoadEvent("ownersDl", loadContext));
List<Owner> list = new ArrayList<>();
Owner owner = metadata.create(Owner.class);
owner.setName("Joe");
list.add(owner);
if (loadContext.getQuery().getParameters().isEmpty()) {
owner = metadata.create(Owner.class);
owner.setName("Jane");
list.add(owner);
}
return list;
}
use of io.jmix.ui.screen.Install in project jmix by jmix-framework.
the class EditorScreenFacetTestScreen method provideEntity.
@Install(to = "editorScreenFacet", subject = "entityProvider")
public Order provideEntity() {
Order order = metadata.create(Order.class);
order.setNumber("Test order");
return order;
}
use of io.jmix.ui.screen.Install in project jmix by jmix-framework.
the class EditorScreenFacetTestScreen method provideOrder.
@Install(to = "editorEntityProvider", subject = "entityProvider")
public Order provideOrder() {
Order order = metadata.create(Order.class);
order.setNumber("Test order");
return order;
}
use of io.jmix.ui.screen.Install in project jmix by jmix-framework.
the class SourceCodeEditorScreenTest method sourceCodeEditorSuggester.
@Install(to = "sourceCodeEditor", subject = "suggester")
private List<Suggestion> sourceCodeEditorSuggester(AutoCompleteSupport source, String text, int cursorPosition) {
List<String> options = Arrays.asList("___");
List<Suggestion> suggestions = new ArrayList<>();
for (String item : options) {
suggestions.add(new Suggestion(source, item, item, null, startPosition, endPosition));
}
return suggestions;
}
Aggregations