本文整理汇总了Java中javafx.scene.control.MenuItem.setMnemonicParsing方法的典型用法代码示例。如果您正苦于以下问题:Java MenuItem.setMnemonicParsing方法的具体用法?Java MenuItem.setMnemonicParsing怎么用?Java MenuItem.setMnemonicParsing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.MenuItem
的用法示例。
在下文中一共展示了MenuItem.setMnemonicParsing方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: TextPaneMenu
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
public TextPaneMenu(TextArea textArea) {
this.textArea = textArea;
MenuItem copy = new MenuItem("_Copy");
this.setStyle(FontUtils.setUIFont(this.getStyle()));
copy.setMnemonicParsing(true);
copy.setOnAction(e -> {
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
StringSelection s = new StringSelection(
textArea.getSelectedText()
);
clipboard.setContents(s, null);
});
copy.setGraphic(new ImageView(ImageUtils.copyImage));
getItems().addAll(copy);
}
示例2: AsciiPaneMenu
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
public AsciiPaneMenu(TextArea textArea) {
this.textArea = textArea;
MenuItem copy = new MenuItem("_Copy");
this.setStyle(FontUtils.setUIFont(this.getStyle()));
copy.setMnemonicParsing(true);
copy.setOnAction(e -> {
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
StringSelection s = new StringSelection(
textArea.getSelectedText().replace("\n", "")
);
clipboard.setContents(s, null);
});
copy.setGraphic(new ImageView(ImageUtils.copyImage));
getItems().addAll(copy);
}
示例3: fileMenu
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
@Bean
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public Menu fileMenu() {
Menu file = new Menu(localeService.getMessage("ui.menu.file"));
file.setMnemonicParsing(false);
MenuItem connect = new MenuItem(localeService.getMessage("ui.menu.file.connect"));
connect.setMnemonicParsing(false);
connect.setOnAction(event -> newConnectionBox(getMainView().getPrimaryStage(),
(data) -> getMainController().loadTables(data)));
MenuItem manager = new MenuItem(localeService.getMessage("ui.menu.file.manager"));
manager.setMnemonicParsing(false);
manager.setOnAction(event -> connectionManager());
file.getItems().addAll(connect, manager);
return file;
}
示例4: HexPaneMenu
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
public HexPaneMenu(TextArea textArea) {
MenuItem copy = new MenuItem("_Copy");
this.setStyle(FontUtils.setUIFont(this.getStyle()));
copy.setMnemonicParsing(true);
copy.setOnAction(e -> {
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
StringSelection s = new StringSelection(
textArea.getSelectedText().replace("\n", "")
);
clipboard.setContents(s, null);
});
copy.setGraphic(new ImageView(ImageUtils.copyImage));
getItems().addAll(
copy
);
}
示例5: helpMenu
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
@Bean
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
public Menu helpMenu() {
Menu file = new Menu(localeService.getMessage("ui.menu.help"));
file.setMnemonicParsing(false);
MenuItem about = new MenuItem(localeService.getMessage("ui.menu.help.about"));
about.setMnemonicParsing(false);
about.setOnAction(event -> aboutBox());
file.getItems().add(about);
return file;
}
示例6: StvsMenuBarController
import javafx.scene.control.MenuItem; //导入方法依赖的package包/类
/**
* create a StvsMenuBarController; the parameters will be modified.
*
* @param rootModel the applications root model
*/
public StvsMenuBarController(ObjectProperty<StvsRootModel> rootModel) {
// set own properties
this.rootModel = rootModel;
// create view
this.view = new StvsMenuBar();
rootModel.get().getHistory().getFilenames()
.addListener(new HistoryFilenamesChangeListener());
// Fill history menu
updateHistoryMenu();
// add listener
view.newCode.setOnAction(this::createNewCode);
view.newSpec.setOnAction(this::createNewSpec);
view.open.setOnAction(this::openFile);
view.openSession.setOnAction(this::openSession);
view.openCode.setOnAction(this::openCode);
view.openSpec.setOnAction(this::openSpec);
view.saveAll.setOnAction(this::saveAll);
view.saveSessionAs.setOnAction(this::saveSessionAs);
view.saveCode.setOnAction(this::saveCode);
view.saveSpec.setOnAction(this::saveSpec);
view.config.setOnAction(this::openConfigDialog);
view.wizard.setOnAction(this::openWizard);
view.about.setOnAction(this::openAboutDialog);
//popluate examples
for (Example ex : ExamplesFacade.getExamples()) {
final Example a = ex;
final MenuItem mex = new MenuItem(ex.getName());
mex.setOnAction((value) -> this.openExample(a));
mex.setMnemonicParsing(true);
Tooltip.install(mex.getGraphic(), new Tooltip(ex.getDescription()));
view.examples.getItems().add(mex);
}
}