use of javafx.beans.property.SimpleListProperty in project Challenger4SysAdmins by fvarrui.
the class MenuBuilder method getMenu.
/**
* @param itemSelected elemento que tengamos seleccionado.
*
* @return menu contextual correspondiente al tipo del objeto seleccionado.
*/
public static ContextMenu getMenu(TreeItem<Object> itemSelected) {
ContextMenu contextMenu = new ContextMenu();
ListProperty<MenuItem> menuItems = new SimpleListProperty<>(FXCollections.observableArrayList());
if (itemSelected.getParent() == null) {
menuItems.add(new MenuItem("A�adir Goal", new ImageView(new Image("/fvarrui/sysadmin/editor/ui/resources/mas-16x16.png"))));
menuItems.add(new MenuItem("Eliminar Goal", new ImageView(new Image("/fvarrui/sysadmin/editor/ui/resources/menos-16x16.png"))));
contextMenu.getItems().addAll(menuItems);
} else {
menuItems.add(new MenuItem("A�adir Test", new ImageView(new Image("/fvarrui/sysadmin/editor/ui/resources/mas-16x16.png"))));
menuItems.add(new MenuItem("Eliminar Test", new ImageView(new Image("/fvarrui/sysadmin/editor/ui/resources/menos-16x16.png"))));
contextMenu.getItems().addAll(menuItems);
}
return contextMenu;
}
Aggregations