本文整理了Java中javafx.event.ActionEvent.consume()
方法的一些代码示例,展示了ActionEvent.consume()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ActionEvent.consume()
方法的具体详情如下:
包路径:javafx.event.ActionEvent
类名称:ActionEvent
方法名:consume
暂无
代码示例来源:origin: com.bitplan.gui/com.bitplan.javafx
@Override
public void handle(final ActionEvent actionEvent) {
linker.browse(help);
actionEvent.consume();
}
});
代码示例来源:origin: ssaring/sportstracker
@Override
protected void addCustomButtons(final DialogPane dialogPane) {
// add 'Calculate' button to button bar
final ButtonType bTypeCalculate = new ButtonType(context.getResources().getString(
"st.dlg.statistic.calculate.Action.text"), ButtonBar.ButtonData.OK_DONE);
dialogPane.getButtonTypes().add(bTypeCalculate);
final Button buttonCalculate = (Button) dialogPane.lookupButton(bTypeCalculate);
// set action event filter for this custom button
// => the event must be consumed, otherwise the dialog will be closed
buttonCalculate.addEventFilter(ActionEvent.ACTION, (event) -> {
event.consume();
onCalculate(event);
});
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
/**
* @param configuration
* @param controller
* @param contextualTo
*/
public void build(List<VLViewComponentXML> configuration, AbstractViewController controller, CriteriaContext criteriaContext, Node contextualTo) {
contextMenu = new ContextMenu(controller, configuration, criteriaContext);
contextMenu.setContextualTo(contextualTo);
ellipsisButton.managedProperty().bind(ellipsisButton.visibleProperty());
ellipsisButton.setOnAction(e -> {
e.consume();
if (contextMenu.isShowing()) {
contextMenu.hide();
return;
}
contextMenu.show(ellipsisButton);
});
}
代码示例来源:origin: no.tornado/tornadofx-controls
private void createDatePicker() {
datePicker = new DatePicker(getItem());
datePicker.converterProperty().bind(converterProperty());
datePicker.setOnAction(event -> {
commitEdit(datePicker.getValue());
event.consume();
});
datePicker.setOnKeyReleased(t -> {
if (t.getCode() == KeyCode.ESCAPE) {
cancelEdit();
t.consume();
}
});
}
代码示例来源:origin: ssaring/sportstracker
event.consume();
代码示例来源:origin: eu.binjr/binjr-adapter-rrd4j
} catch (CannotInitializeDataAdapterException e) {
Dialogs.notifyError("Error initializing adapter to source", e, Pos.CENTER, pathsField);
ae.consume();
} catch (DataAdapterException e) {
Dialogs.notifyError("Error with the adapter to source", e, Pos.CENTER, pathsField);
ae.consume();
} catch (Throwable e) {
Dialogs.notifyError("Unexpected error while retrieving data adapter", e, Pos.CENTER, pathsField);
ae.consume();
内容来源于网络,如有侵权,请联系作者删除!