MenuBar control. In essence it is
a simple toolbar. For the time being there is no overflow behavior and we just
hide nodes which fall outside the bounds.
MenuBar
| Modifier and Type | Field and Description |
|---|---|
| private static final CssMetaData | |
| private boolean | |
| private final HBox | container
contains MenuBarButton's children only |
| private ObjectProperty | containerAlignment
Specifies the alignment of the menu buttons inside the MenuBar (by default it is Pos.TOP_LEFT). |
| private static Stage | |
| pack-priv Runnable | |
| private int | focusedMenuIndex
index of *focused* MenuBarButton |
| private EventHandler | |
| private ChangeListener | |
| private ListChangeListener | |
| private ChangeListener | |
| private Menu | |
| private MenuBarButton | |
| private boolean | |
| private ChangeListener | |
| private ListenerHelper | |
| private DoubleProperty | spacing
Specifies the spacing between menu buttons on the MenuBar. |
| private static final CssMetaData | |
| private static final ObservableList | |
| private static final List | |
| private static WeakHashMap | |
| private WeakChangeListener | |
| private WeakChangeListener | |
| private IDisconnectable | |
| private static List | |
| private List |
| Access | Constructor and Description |
|---|---|
| public | MenuBarSkin(final MenuBar
The control that this skin should be installed onto. control)Creates a new MenuBarSkin instance, installing the necessary child
nodes into the Control |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| private void | |
| private void | |
| protected double | computeMaxHeight(double
The width of the Skin, in case this value might dictate
the maximum height. width, double the pixel snapped top inset topInset, double the pixel snapped right inset rightInset, double the pixel snapped bottom inset bottomInset, double the pixel snapped left inset leftInset)Overrides javafx. Computes the maximum allowable height of the Skin, based on the provided width. |
| protected double | computeMinHeight(double
The width of the Skin, in case this value might dictate
the minimum height. width, double the pixel snapped top inset topInset, double the pixel snapped right inset rightInset, double the pixel snapped bottom inset bottomInset, double the pixel snapped left inset leftInset)Overrides javafx. Computes the minimum allowable height of the Skin, based on the provided width. |
| protected double | computeMinWidth(double
The height of the Skin, in case this value might dictate
the minimum width. height, double the pixel snapped top inset topInset, double the pixel snapped right inset rightInset, double the pixel snapped bottom inset bottomInset, double the pixel snapped left inset leftInset)Overrides javafx. Computes the minimum allowable width of the Skin, based on the provided height. |
| protected double | computePrefHeight(double
the width that should be used if preferred height depends on it width, double the pixel snapped top inset topInset, double the pixel snapped right inset rightInset, double the pixel snapped bottom inset bottomInset, double the pixel snapped left inset leftInset)Overrides javafx. Calculates the preferred height of this |
| protected double | computePrefWidth(double
the height that should be used if preferred width depends on it height, double the pixel snapped top inset topInset, double the pixel snapped right inset rightInset, double the pixel snapped bottom inset bottomInset, double the pixel snapped left inset leftInset)Overrides javafx. Calculates the preferred width of this |
| public final ObjectProperty | |
| public void | dispose()
Overrides javafx. Implements javafx. Called when a previously installed skin is about to be removed from its associated control. |
| private Optional | |
| public static List | Returns: the CssMetaData associated with this class, which may include the CssMetaData of its superclassesHides javafx. Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses. |
| public final Pos | |
| public List | getCssMetaData()
Overrides javafx. This method should delegate to |
| pack-priv int | |
| private int | |
| private static MenuBarSkin | |
| public final double | |
| private static void | |
| private boolean | |
| protected void | layoutChildren(final double
the x position x, final double the y position y, final double the width w, final double the height h)Overrides javafx. Called during the layout pass of the scenegraph. |
| pack-priv MenuBarButton | |
| private boolean | |
| private void | |
| private void | |
| private boolean | |
| private void | |
| protected Object | queryAccessibleAttribute(AccessibleAttribute
the requested attribute attribute, Object... optional list of parameters parameters)Overrides javafx. This method is called by the assistive technology to request the value for an attribute. |
| private void | |
| private void | |
| public final void | |
| public static void | |
| pack-priv void | setFocusedMenuIndex(int index)
This method is package scoped as it is used in this class as well as for testing |
| public final void | |
| private static void | |
| private void | |
| private void | |
| protected double | snappedBottomInset()
Overrides javafx. Utility method to get the bottom inset which includes padding and border inset. |
| protected double | snappedLeftInset()
Overrides javafx. Utility method to get the left inset which includes padding and border inset. |
| protected double | snappedRightInset()
Overrides javafx. Utility method to get the right inset which includes padding and border inset. |
| protected double | snappedTopInset()
Overrides javafx. Utility method to get the top inset which includes padding and border inset. |
| public final DoubleProperty | |
| private void | |
| private void | |
| private void |
| ALIGNMENT | back to summary |
|---|---|
| private static final CssMetaData<MenuBar, Pos> ALIGNMENT | |
| altKeyPressed | back to summary |
|---|---|
| private boolean altKeyPressed | |
| container | back to summary |
|---|---|
| private final HBox container contains MenuBarButton's children only | |
| containerAlignment | back to summary |
|---|---|
| private ObjectProperty<Pos> containerAlignment Specifies the alignment of the menu buttons inside the MenuBar (by default it is Pos.TOP_LEFT). | |
| currentMenuBarStage | back to summary |
|---|---|
| private static Stage currentMenuBarStage | |
| firstMenuRunnable | back to summary |
|---|---|
| pack-priv Runnable firstMenuRunnable | |
| focusedMenuIndex | back to summary |
|---|---|
| private int focusedMenuIndex index of *focused* MenuBarButton | |
| menuActionEventHandler | back to summary |
|---|---|
| private EventHandler<ActionEvent> menuActionEventHandler | |
| menuBarFocusedPropertyListener | back to summary |
|---|---|
| private ChangeListener<Boolean> menuBarFocusedPropertyListener | |
| menuItemListener | back to summary |
|---|---|
| private ListChangeListener<MenuItem> menuItemListener | |
| menuVisibilityChangeListener | back to summary |
|---|---|
| private ChangeListener<Boolean> menuVisibilityChangeListener | |
| openMenu | back to summary |
|---|---|
| private Menu openMenu | |
| openMenuButton | back to summary |
|---|---|
| private MenuBarButton openMenuButton | |
| pendingDismiss | back to summary |
|---|---|
| private boolean pendingDismiss | |
| sceneChangeListener | back to summary |
|---|---|
| private ChangeListener<Scene> sceneChangeListener | |
| sceneListenerHelper | back to summary |
|---|---|
| private ListenerHelper sceneListenerHelper | |
| spacing | back to summary |
|---|---|
| private DoubleProperty spacing Specifies the spacing between menu buttons on the MenuBar. | |
| SPACING | back to summary |
|---|---|
| private static final CssMetaData<MenuBar, Number> SPACING | |
| stages | back to summary |
|---|---|
| private static final ObservableList<Window> stages | |
| STYLEABLES | back to summary |
|---|---|
| private static final List<CssMetaData<? extends Styleable, ?>> STYLEABLES | |
| systemMenuMap | back to summary |
|---|---|
| private static WeakHashMap<Stage, Reference<MenuBarSkin>> systemMenuMap | |
| weakMenuBarFocusedPropertyListener | back to summary |
|---|---|
| private WeakChangeListener<Boolean> weakMenuBarFocusedPropertyListener | |
| weakMenuVisibilityChangeListener | back to summary |
|---|---|
| private WeakChangeListener<Boolean> weakMenuVisibilityChangeListener | |
| windowFocusHelper | back to summary |
|---|---|
| private IDisconnectable windowFocusHelper | |
| wrappedDefaultMenus | back to summary |
|---|---|
| private static List<MenuBase> wrappedDefaultMenus | |
| wrappedMenus | back to summary |
|---|---|
| private List<MenuBase> wrappedMenus | |
| MenuBarSkin | back to summary |
|---|---|
| public MenuBarSkin(final MenuBar control) Creates a new MenuBarSkin instance, installing the necessary child
nodes into the Control
| |
| cleanUpListeners | back to summary |
|---|---|
| private void cleanUpListeners() | |
| cleanUpSystemMenu | back to summary |
|---|---|
| private void cleanUpSystemMenu() | |
| clearMenuButtonHover | back to summary |
|---|---|
| private void clearMenuButtonHover() | |
| computeMaxHeight | back to summary |
|---|---|
| protected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Computes the maximum allowable height of the Skin, based on the provided width.
| |
| computeMinHeight | back to summary |
|---|---|
| protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Computes the minimum allowable height of the Skin, based on the provided width.
| |
| computeMinWidth | back to summary |
|---|---|
| protected double computeMinWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Computes the minimum allowable width of the Skin, based on the provided height.
| |
| computePrefHeight | back to summary |
|---|---|
| protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Calculates the preferred height of this
| |
| computePrefWidth | back to summary |
|---|---|
| protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) Overrides javafx. Doc from javafx. Calculates the preferred width of this
| |
| containerAlignmentProperty | back to summary |
|---|---|
| public final ObjectProperty | |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides javafx. Implements javafx. Doc from javafx. Called when a previously installed skin is about to be removed from its associated control.
This allows the skin to do clean up, like removing listeners and bindings, and undo any changes
to the control's properties.
After this method completes,
Calling
| |
| findSibling | back to summary |
|---|---|
| private Optional | |
| getClassCssMetaData | back to summary |
|---|---|
| public static List Hides javafx. Returns the CssMetaData associated with this class, which may include the CssMetaData of its superclasses.
| |
| getContainerAlignment | back to summary |
|---|---|
| public final Pos getContainerAlignment() | |
| getCssMetaData | back to summary |
|---|---|
| public List Overrides javafx. Doc from javafx. This method should delegate to
| |
| getFocusedMenuIndex | back to summary |
|---|---|
| pack-priv int getFocusedMenuIndex() | |
| getMenuBarButtonIndex | back to summary |
|---|---|
| private int getMenuBarButtonIndex(MenuBarButton m) | |
| getMenuBarSkin | back to summary |
|---|---|
| private static MenuBarSkin getMenuBarSkin(Stage stage) | |
| getSpacing | back to summary |
|---|---|
| public final double getSpacing() | |
| initSystemMenuBar | back to summary |
|---|---|
| private static void initSystemMenuBar() | |
| isMenuEmpty | back to summary |
|---|---|
| private boolean isMenuEmpty(Menu menu) | |
| layoutChildren | back to summary |
|---|---|
| protected void layoutChildren(final double x, final double y, final double w, final double h) Overrides javafx. Doc from javafx. Called during the layout pass of the scenegraph.
| |
| menuBarButtonAt | back to summary |
|---|---|
| pack-priv MenuBarButton menuBarButtonAt(int i) | |
| menuContainsCustomMenuItem | back to summary |
|---|---|
| private boolean menuContainsCustomMenuItem(Menu menu) | |
| menuModeEnd | back to summary |
|---|---|
| private void menuModeEnd() | |
| menuModeStart | back to summary |
|---|---|
| private void menuModeStart(int newIndex) | |
| menusContainCustomMenuItem | back to summary |
|---|---|
| private boolean menusContainCustomMenuItem() | |
| moveToMenu | back to summary |
|---|---|
| private void moveToMenu(Direction dir, boolean doShow) | |
| queryAccessibleAttribute | back to summary |
|---|---|
| protected Object queryAccessibleAttribute(AccessibleAttribute attribute, Object... parameters) Overrides javafx. Doc from javafx. This method is called by the assistive technology to request the value for an attribute.
This method is commonly overridden by subclasses to implement
attributes that are required for a specific role.
| |
| rebuildUI | back to summary |
|---|---|
| private void rebuildUI() | |
| resetOpenMenu | back to summary |
|---|---|
| private void resetOpenMenu() | |
| setContainerAlignment | back to summary |
|---|---|
| public final void setContainerAlignment(Pos value) | |
| setDefaultSystemMenuBar | back to summary |
|---|---|
| public static void setDefaultSystemMenuBar(final MenuBar menuBar) Set the default system menu bar. This allows an application to keep menu in the system menu bar after the last Window is closed.
| |
| setFocusedMenuIndex | back to summary |
|---|---|
| pack-priv void setFocusedMenuIndex(int index) This method is package scoped as it is used in this class as well as for testing | |
| setSpacing | back to summary |
|---|---|
| public final void setSpacing(double value) | |
| setSystemMenu | back to summary |
|---|---|
| private static void setSystemMenu(Stage stage) | |
| showMenu | back to summary |
|---|---|
| private void showMenu(Menu menu) | |
| showMenu | back to summary |
|---|---|
| private void showMenu(Menu menu, boolean selectFirstItem) | |
| snappedBottomInset | back to summary |
|---|---|
| protected double snappedBottomInset() Overrides javafx. Doc from javafx. Utility method to get the bottom inset which includes padding and border inset. Then snapped to whole pixels if getSkinnable().isSnapToPixel() is true.
| |
| snappedLeftInset | back to summary |
|---|---|
| protected double snappedLeftInset() Overrides javafx. Doc from javafx. Utility method to get the left inset which includes padding and border inset. Then snapped to whole pixels if getSkinnable().isSnapToPixel() is true.
| |
| snappedRightInset | back to summary |
|---|---|
| protected double snappedRightInset() Overrides javafx. Doc from javafx. Utility method to get the right inset which includes padding and border inset. Then snapped to whole pixels if getSkinnable().isSnapToPixel() is true.
| |
| snappedTopInset | back to summary |
|---|---|
| protected double snappedTopInset() Overrides javafx. Doc from javafx. Utility method to get the top inset which includes padding and border inset. Then snapped to whole pixels if getSkinnable().isSnapToPixel() is true.
| |
| spacingProperty | back to summary |
|---|---|
| public final DoubleProperty spacingProperty() | |
| unSelectMenus | back to summary |
|---|---|
| private void unSelectMenus() | |
| updateActionListeners | back to summary |
|---|---|
| private void updateActionListeners(MenuItem item, boolean add) | |
| updateFocusedIndex | back to summary |
|---|---|
| private void updateFocusedIndex() | |