public class MenuItemUtils
extends java.lang.Object
MenuItem.
I wanted to reuse the code of ControlUtils for the fill methods of this class but
menu items and buttons do not share a common class, thus this is copy'n'paste
for the moment.
When trying Kotlin, all static methods are candidates for extending the menuitem class.
Legal stuff
Copyright 2010-2020 Ekkart Kleinod ekleinod@edgesoft.de
This file is part of edgeutils.
edgeutils is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
edgeutils is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with edgeutils. If not, see http://www.gnu.org/licenses/.
- Since:
- 0.12.0
- Author:
- Ekkart Kleinod
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPREFIXVariable name prefix. -
Constructor Summary
Constructors Constructor Description MenuItemUtils() -
Method Summary
Modifier and Type Method Description static javafx.scene.control.MenuItemcopyMenuItem(javafx.scene.control.MenuItem theMenuItem)Copies menu item.static voidfillMenuItem(javafx.scene.control.MenuItem theMenuItem, java.lang.Object theController, int theSize, ResourceType... theResourceTypes)Fills menu item with graphic and text.static voidfillMenuItem(javafx.scene.control.MenuItem theMenuItem, java.lang.Object theController, ResourceType... theResourceTypes)Fills menu item with graphic and text.
-
Field Details
-
PREFIX
public static final java.lang.String PREFIXVariable name prefix.- See Also:
- Constant Field Values
-
-
Constructor Details
-
MenuItemUtils
public MenuItemUtils()
-
-
Method Details
-
copyMenuItem
public static javafx.scene.control.MenuItem copyMenuItem(javafx.scene.control.MenuItem theMenuItem)Copies menu item.- Parameters:
theMenuItem- menu item to adapt from- Returns:
- new menu item with copied content
-
fillMenuItem
public static void fillMenuItem(javafx.scene.control.MenuItem theMenuItem, java.lang.Object theController, ResourceType... theResourceTypes)Fills menu item with graphic and text.- Parameters:
theMenuItem- menu item to filltheController- view controllertheResourceTypes- resource types- Since:
- 0.13.0
-
fillMenuItem
public static void fillMenuItem(javafx.scene.control.MenuItem theMenuItem, java.lang.Object theController, int theSize, ResourceType... theResourceTypes)Fills menu item with graphic and text.- Parameters:
theMenuItem- menu item to filltheController- view controllertheSize- size of the icontheResourceTypes- resource types- Since:
- 0.13.0
-