javafx.event.Event.consume()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(265)

本文整理了Java中javafx.event.Event.consume()方法的一些代码示例,展示了Event.consume()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.consume()方法的具体详情如下:
包路径:javafx.event.Event
类名称:Event
方法名:consume

Event.consume介绍

暂无

代码示例

代码示例来源:origin: org.fxmisc.wellbehaved/wellbehavedfx

@Override
  default void handle(T event) {
    switch(process(event)) {
      case CONSUME: event.consume(); break;
      case PROCEED: /* do nothing */ break;
      case IGNORE:  /* do nothing */ break;
    }
  }
}

代码示例来源:origin: org.drombler.commons/drombler-commons-docking-fx

public EventHandler<Event> createOnCloseRequestHandler(Tab tab, FXDockableEntry dockableEntry, DockingAreaPane dockingAreaPane) {
  return event -> {
    final FXDockableData dockableData = dockableEntry.getDockableData();
    LOG.debug("Closing tab: {} ...", dockableData.getTitle());
    closeRequest = new CloseRequest();
    DockableCloseRequestEvent dockableCloseRequestEvent = new DockableCloseRequestEvent(dockableEntry, dockingAreaPane, dockingAreaPane);
    dockingAreaPane.fireEvent(dockableCloseRequestEvent);
    if (closeRequest.isStopClosingTab()) {
      event.consume();
      LOG.debug("onCloseRequest event consumed for: {}", dockableData.getTitle());
    }
    closeRequest = null;
  };
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

/**
 * One click select, 2 clicks other.
 *
 * @param event
 */
public void handleRowSelection(Event event) {
 if (checkBox.isVisible()) {
  if (((MouseEvent) event).getClickCount() == 1 && !event.isConsumed()) {
   final boolean selected = !checkBox.isSelected();
   checkBox.setSelected(selected);
   event.consume();
  }
 }
}

代码示例来源:origin: PhoenicisOrg/phoenicis

protected void setNextButtonAction(EventHandler<MouseEvent> nextButtonAction) {
  nextButton.setOnMouseClicked(event -> {
    nextButton.setDisable(true);
    nextButtonAction.handle(event);
  });
  this.getParent().setOnCloseRequest(event -> {
    if (this.messageWaitingForResponse != null) {
      this.messageWaitingForResponse.sendCancelSignal();
    }
    event.consume();
  });
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

ev.consume();
String actionName = actionComponent.getPropertyValue("action");
String args = actionComponent.getPropertyValue("args");

相关文章