public void applyTo(javafx.scene.control.MenuBar x) {
   super.applyTo(x);
   int set = __set;
   if ((set & (1 << 0)) != 0) x.getMenus().addAll(this.menus);
   if ((set & (1 << 1)) != 0) x.setUseSystemMenuBar(this.useSystemMenuBar);
 }
示例#2
0
  @Override
  public void initialize(URL arg0, ResourceBundle arg1) {
    log.debug("Controller.initialize");
    service = new BbsService();
    service.setController(this);
    service.init();
    service.updateBoardList();
    boardTreeView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
    boardTreeView
        .getSelectionModel()
        .selectedItemProperty()
        .addListener(
            new ChangeListener() {
              @Override
              public void changed(ObservableValue observable, Object oldValue, Object newValue) {
                if (boardTreeView.getSelectionModel().getSelectedItem() == null) {
                  return;
                }
                Board board =
                    (Board) boardTreeView.getSelectionModel().getSelectedItem().getValue();
                if (board.getUrl() == null) {
                  return;
                }
                log.debug("選択 " + board);
                service.openBoard(board);
              }
            });

    messageThreadListView.setCellFactory(
        new Callback<ListView<MessageThread>, ListCell<MessageThread>>() {
          @Override
          public ListCell<MessageThread> call(ListView<MessageThread> param) {
            return new MessageThreadCell();
          }
        });
    messageThreadListView
        .getSelectionModel()
        .selectedItemProperty()
        .addListener(
            new ChangeListener() {
              @Override
              public void changed(ObservableValue observable, Object oldValue, Object newValue) {
                MessageThread messageThread =
                    (MessageThread) messageThreadListView.getSelectionModel().getSelectedItem();
                if (messageThread != null) {
                  messageThreadTitleLabel.setText(messageThread.getTitle());
                  service.openMessageThread(messageThread);
                }
              }
            });
    webEngine = messageView.getEngine();
    setupToolbar(boardListToolbar);
    setupToolbar(messageListToolbar);
    setupToolbar(threadListToolbar);

    if (IrisWindow.isMac()) {
      menuBar.setUseSystemMenuBar(true);
    } else {
      menuBar.setUseSystemMenuBar(false);
      closeButton.setVisible(false);
      minimizedButton.setVisible(false);
      maximizedButton.setVisible(false);
    }

    service.openLastSelectedItem();
  }