本文整理汇总了Java中javafx.scene.control.MenuItem.getText方法的典型用法代码示例。如果您正苦于以下问题:Java MenuItem.getText方法的具体用法?Java MenuItem.getText怎么用?Java MenuItem.getText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.MenuItem
的用法示例。
在下文中一共展示了MenuItem.getText方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMenuItemText
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
public String getMenuItemText(Menu parentMenu, int index) {
MenuItem menuItem = parentMenu.getItems().get(index);
String text = menuItem.getText();
if (text == null || "".equals(text)) {
return getTextFromIcon(menuItem, index);
}
return text;
}
示例2: getTextForMenuItem
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
public String getTextForMenuItem(MenuItem menuItem) {
Menu parentMenu = menuItem.getParentMenu();
if (parentMenu == null) {
String text = menuItem.getText();
if (text == null || "".equals(text)) {
return getTextFromIcon(menuItem, -1);
}
return text;
}
return getTextForMenuItem(menuItem, parentMenu);
}
示例3: getTextForMenuItem
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
public String getTextForMenuItem(MenuItem menuItem) {
Menu parentMenu = menuItem.getParentMenu();
if (parentMenu == null) {
if (menuBar != null) {
ObservableList<Menu> menus = menuBar.getMenus();
return parentMenuText(menus, menus.indexOf(menuItem));
}
String text = menuItem.getText();
if (text == null || "".equals(text)) {
return getTextFromIcon(menuItem, -1);
}
return text;
}
return getTextForMenuItem(menuItem, parentMenu);
}
示例4: onDataImportAction
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
private EventHandler<ActionEvent> onDataImportAction(FinancialMarket fm, TatConfig config) {
return new EventHandler<ActionEvent>() {
public void handle(ActionEvent event) {
MenuItem mItem = (MenuItem) event.getSource();
String cmdString = mItem.getText();
if(cmdString.equalsIgnoreCase("Market data import...")) {
Window ownerStage = primaryStage.getScene().getWindow();
DataImportDialog dlg = new DataImportDialog(ownerStage, fm, config);
dlg.sizeToScene();
dlg.show();
}
}
};
}
示例5: onDataUpdateAction
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
private EventHandler<ActionEvent> onDataUpdateAction(TatMain app, FinancialMarket fm, TatConfig config) {
return new EventHandler<ActionEvent>() {
public void handle(ActionEvent event) {
MenuItem mItem = (MenuItem) event.getSource();
String cmdString = mItem.getText();
if(cmdString.equalsIgnoreCase("Market data update...")) {
Window ownerStage = primaryStage.getScene().getWindow();
DataUpdateDialog dlg = new DataUpdateDialog(application, ownerStage, fm, config, true);
dlg.sizeToScene();
dlg.show();
}
}
};
}
示例6: traiterMaladieClick
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
@FXML
public void traiterMaladieClick(Event event){
MenuItem mi = (MenuItem) event.getSource();
String color = mi.getText();
try {
this.cdGame.retirerCubeMaladie(this.param.getName(),color.toUpperCase());
} catch (RemoteException ex) {
Logger.getLogger(BoardController.class.getName()).log(Level.SEVERE, null, ex);
}
}
示例7: decouvrirRemedeClick
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
@FXML
public void decouvrirRemedeClick(Event event){
MenuItem mi = (MenuItem) event.getSource();
String color = mi.getText();
try {
this.cdGame.decouvrirRemede(this.param.getName(),carteSelected,color);
} catch (RemoteException ex) {
Logger.getLogger(BoardController.class.getName()).log(Level.SEVERE, null, ex);
}
}