documentation icon indicating copy to clipboard operation
documentation copied to clipboard

Document @Install and its usages in components

Open alexbudarov opened this issue 6 years ago • 2 comments

Environment

  • Documentation version: Snapshot
  • Part of the documentation: Manual

Description

If you search "@ Install" in existing documentation - it's not well documented (idea, purpose, usages in components).

As an example - Table.Column delegates (formatter, columnGenerator, valueProvider) are not mentioned in documentation at all.

alexbudarov avatar Jun 20 '19 11:06 alexbudarov

Add @Subscribe and @Install to https://doc.cuba-platform.com/manual-7.0/screen_controller_annotations.html

knstvk avatar Jun 21 '19 06:06 knstvk

Also for methods like setOptionImageProvider() (i.e. setters of providers) add examples of using them with @Install (by generating this code in Studio "Handlers" tab):

@Inject
private Image imageResource;

@Install(to = "fooLookupField", subject = "optionImageProvider")
private Resource fooLookupFieldOptionImageProvider(Foo foo) {
    String iconName = Boolean.TRUE.equals(foo.getStatus()) ? "icons/active.svg" : "icons/inactive.svg";
    return imageResource.createResource(ThemeResource.class).setPath(iconName);
}

knstvk avatar Apr 09 '20 12:04 knstvk