Search in sources :

Example 6 with Install

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);
}
Also used : Install(io.jmix.ui.screen.Install)

Example 7 with Install

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;
}
Also used : Owner(test_support.entity.petclinic.Owner) ArrayList(java.util.ArrayList) Install(io.jmix.ui.screen.Install)

Example 8 with Install

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;
}
Also used : Order(test_support.entity.sales.Order) Install(io.jmix.ui.screen.Install)

Example 9 with Install

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;
}
Also used : Order(test_support.entity.sales.Order) Install(io.jmix.ui.screen.Install)

Example 10 with Install

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;
}
Also used : Suggestion(io.jmix.ui.component.autocomplete.Suggestion) ArrayList(java.util.ArrayList) Install(io.jmix.ui.screen.Install)

Aggregations

Install (io.jmix.ui.screen.Install)10 ArrayList (java.util.ArrayList)3 Order (test_support.entity.sales.Order)2 Owner (com.haulmont.cuba.core.model.Owner)1 Pet (com.haulmont.cuba.core.model.Pet)1 TemplateTableBand (io.jmix.reports.entity.table.TemplateTableBand)1 TemplateTableColumn (io.jmix.reports.entity.table.TemplateTableColumn)1 Suggestion (io.jmix.ui.component.autocomplete.Suggestion)1 Owner (test_support.entity.petclinic.Owner)1 Pet (test_support.entity.petclinic.Pet)1