Skip to content
miguelperezcolom edited this page Sep 22, 2024 · 5 revisions

When using Mateu you create the main menu of the application by annotating fields of your UI class with @Menuoption and @Submenu.

E.g. the following code:

public class DemoApp {

  @Submenu private FormsSubmenu forms;

  @Submenu private CollectionsSubmenu collections;

  @Submenu private RefsSubmenu refs;

  @Submenu private CrudsSubmenu cruds;

  @Submenu private ActionsSubmenu actions;

  @Submenu private LayoutsSubmenu layouts;

  @Submenu private UtilSubmenu util;

  @Submenu private UseCasesSubmenu useCases;

  @MenuOption @Private private BasicFieldsForm eyesOnly;

}

generates the following menu:

The nested menu is created using the @Submenu annotation. E.g.:

public class CrudsSubmenu {

    @MenuOption private ProgrammingLanguages programmingLanguages;

    @MenuOption
    private JpaCrud<City> cities =
            new JpaCrud<City>() {

                @Override
                public List<String> getSearchFilterFields() {
                    return List.of("name", "country", "population");
                }

                @Override
                public List<String> getColumnFields() {
                    return List.of("name", "country", "population");
                }
            };

    @Submenu("NFL")
    private NFLSubmenu nfl;

    @Submenu("Star Wars")
    private SWSubmenu sw;

    @MenuOption private BrokenCrud brokenCrud;

}

You can nest any number of menu levels.

Clone this wiki locally