javafx.scene.control.Tab.setOnClosed()方法的使用及代码示例

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

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

Tab.setOnClosed介绍

暂无

代码示例

代码示例来源:origin: org.copper-engine/copper-monitoring-client

  1. @Override
  2. public void handle(Event event) {
  3. // workaround for javafx memeoryleaks RT-25652, RT-32087
  4. formTabFinal.setContent(null);
  5. formTabFinal.textProperty().unbind();
  6. formTabFinal.setOnClosed(null);
  7. form.close();
  8. }
  9. });

代码示例来源:origin: org.copper-engine/copper-monitoring-client

  1. formTab.setOnClosed(new EventHandler<Event>() {
  2. @Override
  3. public void handle(Event event) {

代码示例来源:origin: io.datafx/flow

  1. /**
  2. * This methods creates a tab that contains the given view.
  3. * By doing so the metadata of the view will be bound to the tab properties.
  4. * So the text and icon of the tab can be changed by the view.
  5. *
  6. * @param context the context of the view. This includes the view and its controller instance
  7. * so that all needed informations are part of the context
  8. * @param exceptionHandler the exception handle for the view. This handler will handle all exceptions that will be thrown in the DataFX container context
  9. */
  10. public <T> Tab createTab(ViewContext<T> context, ExceptionHandler exceptionHandler) {
  11. Tab tab = new Tab();
  12. tab.textProperty().bind(context.getMetadata().titleProperty());
  13. tab.graphicProperty().bind(context.getMetadata().graphicsProperty());
  14. tab.setOnClosed(e -> {
  15. try {
  16. context.destroy();
  17. } catch (Exception exception) {
  18. exceptionHandler.setException(exception);
  19. }
  20. });
  21. tab.setContent(context.getRootNode());
  22. return tab;
  23. }

代码示例来源:origin: io.datafx/flow

  1. public <T extends Node> Tab startInTab(FlowContainer<T> container) throws FlowException {
  2. Tab tab = new Tab();
  3. getCurrentViewMetadata().addListener((e) -> {
  4. tab.textProperty().unbind();
  5. tab.graphicProperty().unbind();
  6. tab.textProperty().bind(getCurrentViewMetadata().get().titleProperty());
  7. tab.graphicProperty().bind(getCurrentViewMetadata().get().graphicsProperty());
  8. });
  9. tab.setOnClosed(e -> {
  10. try {
  11. destroy();
  12. } catch (Exception exception) {
  13. exceptionHandler.setException(exception);
  14. }
  15. });
  16. tab.setContent(start(container));
  17. return tab;
  18. }

相关文章