use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.
the class JavaCodeAreaHelper method createMenus.
/**
* 메뉴 생성
* @작성자 : KYJ
* @작성일 : 2016. 10. 6.
*/
@Override
public void createMenus() {
super.createMenus();
menuPmd = new Menu("PMD");
menuRunPmd = new MenuItem("Run PMD");
menuAutoComment = new MenuItem("Auto Comment");
menuRunPmd.setOnAction(this);
menuAutoComment.setOnAction(this);
menuPmd.getItems().addAll(menuRunPmd);
codeArea.getContextMenu().getItems().addAll(menuPmd, new SeparatorMenuItem(), menuAutoComment);
}
use of javafx.scene.control.MenuItem in project arquivoProject by fader-azevedo.
the class ListaDocumentoController method rightClik.
private ContextMenu rightClik(JFXButton button) {
final ContextMenu contextMenu = new ContextMenu();
MenuItem verDoc = new MenuItem("Ver Pauta");
MaterialDesignIconView iconEye = new MaterialDesignIconView(MaterialDesignIcon.EYE, "20");
verDoc.setGraphic(iconEye);
contextMenu.getItems().addAll(verDoc);
verDoc.setOnAction(e -> {
try {
System.out.println(button.getText());
FXMLLoader loader = new FXMLLoader();
loader.load(getClass().getResource("/view/PdfViewer.fxml").openStream());
Parent parent = loader.getRoot();
File pdfCaminho = new File("documentos/pautas/" + button.getText());
PdfViewerController pdfController = loader.getController();
pdfController.initialize();
pdfController.loadFile(pdfCaminho.toString());
final Stage dialog = new Stage();
dialog.initModality(Modality.APPLICATION_MODAL);
Scene dialogScene = new Scene(parent, 500, 620);
dialog.setScene(dialogScene);
dialog.setTitle(button.getText());
dialog.setResizable(false);
dialog.show();
} catch (IOException ex) {
Logger.getLogger(ListaDocumentoController.class.getName()).log(Level.SEVERE, null, ex);
}
});
return contextMenu;
}
use of javafx.scene.control.MenuItem 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;
}
use of javafx.scene.control.MenuItem in project Board-Instrumentation-Framework by intel.
the class Configuration method AddAbout.
void AddAbout() {
Menu objMenu = new Menu("About");
MenuItem item = new MenuItem("About");
fAboutCreated = true;
item.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent t) {
AboutBox.ShowAboutBox();
}
});
objMenu.getItems().add(item);
_MenuBar.getMenus().add(objMenu);
}
use of javafx.scene.control.MenuItem in project swift by luastar.
the class MainController method initConsoleTextArea.
/**
* 初始化控制台
*/
private void initConsoleTextArea() {
// 不可编辑
consoleTextArea.setEditable(false);
// 右键清除按钮
MenuItem clear = new MenuItem("清除");
clear.setOnAction(event -> consoleTextArea.clear());
ContextMenu contextMenu = new ContextMenu();
contextMenu.getItems().add(clear);
consoleTextArea.setContextMenu(contextMenu);
// 设置日志属性
Logger rootLogger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
Appender<ILoggingEvent> appender = rootLogger.getAppender("gui");
if (appender != null && (appender instanceof GuiLoggerAppender)) {
((GuiLoggerAppender) appender).setConsoleTextArea(consoleTextArea);
}
}
Aggregations