All Downloads are FREE. Search and download functionalities are using the official Maven repository.

it.tidalwave.ui.example.presentation.impl.javafx.JavaFXApplicationPresentationDelegate Maven / Gradle / Ivy

There is a newer version: 3.0-ALPHA-5
Show newest version
/*
 * *************************************************************************************************************************************************************
 *
 * SteelBlue: DCI User Interfaces
 * http://tidalwave.it/projects/steelblue
 *
 * Copyright (C) 2015 - 2025 by Tidalwave s.a.s. (http://tidalwave.it)
 *
 * *************************************************************************************************************************************************************
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License.
 *
 * *************************************************************************************************************************************************************
 *
 * git clone https://bitbucket.org/tidalwave/steelblue-src
 * git clone https://github.com/tidalwave-it/steelblue-src
 *
 * *************************************************************************************************************************************************************
 */
package it.tidalwave.ui.example.presentation.impl.javafx;

import jakarta.annotation.Nonnull;
import javafx.fxml.FXML;
import javafx.scene.control.MenuBar;
import javafx.scene.control.ToolBar;
import javafx.scene.layout.BorderPane;
import it.tidalwave.ui.core.annotation.PresentationAssembler;
import it.tidalwave.ui.core.annotation.Assemble;
import it.tidalwave.ui.javafx.JavaFXBinder;
import it.tidalwave.ui.javafx.JavaFXMenuBarControl;
import it.tidalwave.ui.javafx.JavaFXToolBarControl;

/***************************************************************************************************************************************************************
 *
 * This class is referred by Application.fxml and instantiated by the JavaFX runtime.
 *
 * @author  Fabrizio Giudici
 *
 **************************************************************************************************************************************************************/
// START SNIPPET: all
@PresentationAssembler
public class JavaFXApplicationPresentationDelegate
  {
    @FXML
    private BorderPane pnMainPane;

    @FXML
    private ToolBar tbToolBar;

    @FXML
    private MenuBar mbMenuBar;

    @Assemble
    public void assemble (@Nonnull final JavaFXBinder binder,
                          @Nonnull final JavaFXToolBarControl toolBarModel,
                          @Nonnull final JavaFXMenuBarControl menuBarModel,
                          @Nonnull final JavaFXMainPanelPresentation mainPanelPresentation)
      {
        toolBarModel.populate(binder, tbToolBar);
        menuBarModel.populate(binder, mbMenuBar);
        pnMainPane.setCenter(mainPanelPresentation.getNad().getNode());
      }
  }
// END SNIPPET: all




© 2015 - 2025 Weber Informatics LLC | Privacy Policy