Class MenuSidePopupView

  • All Implemented Interfaces:
    Styleable, EventTarget

    public class MenuSidePopupView
    extends SidePopupView

    The MenuPopupView class is a layer used to show JavaFX Menu instances within the user interface that will scroll out from the edge of the screen.

    Example

    The following example shows a MenuSidePopupView when the user presses a button.

     public class MyApp extends MobileApplication {
      @Override
       public void init() {
         addViewFactory(HOME_VIEW, () -> {
           Button button = new Button("Click");
           button.setOnAction(e -> showLayer("New Layer"));
           return new View(button) {
            @Override
             protected void updateAppBar(AppBar appBar) {
               appBar.setTitleText("MenuSidePopupView");
             }
           };
         });
         addLayerFactory("New Layer", () -> {
           Menu menu = new Menu();
           menu.getItems().addAll(new MenuItem("LEFT"), new MenuItem("RIGHT"), new MenuItem("TOP"), new MenuItem("BOTTOM"));
           MenuSidePopupView popup = new MenuSidePopupView(menu);
           return popup;
         });
       }
     }
     

    Screenshot of MenuSidePopupView

    Since:
    1.0.0
    • Constructor Detail

      • MenuSidePopupView

        public MenuSidePopupView​(Menu menu)
        Creates a new MenuSidePopupView instance that will be displayed from the bottom edge of the screen, containing the contents of the given Menu.
        Parameters:
        menu - The menu to show.
      • MenuSidePopupView

        public MenuSidePopupView​(Menu menu,
                                 Side side)
        Creates a new MenuSidePopupView instance that will be displayed from the side of the screen, as specified by the side parameter. The popup will contain the contents of the given Menu.
        Parameters:
        menu - The menu to show.
        side - The side of the screen to show the menu from.