本文整理匯總了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);
}
}