Skip to content

Working With Layouts

Michael Gentry edited this page Oct 11, 2016 · 2 revisions

Scene Builder

  • Create new FXML file.
  • Make sure the Use fx:root Construct is selected.
  • Create an AnchorPane as the top-level element. This is important due to the expectations of the Java supporting classes.
  • Create your UI inside the AnchorPane. Typically you'll put a VBox or some other container inside the AnchorPane. Look at existing *Layout.fxml files for ideas.
  • Save your UI as *Layout.fxml under src/main/resources/layouts.

Java

  • Create your new Java UI controller file in src/main/java/org/apache/cayenne/modeler/layout and make sure the Java class name matches the name of the *Layout.fxml file (with .fxml being .java, of course).
  • For top-level windows, your Java UI controller should subclass AbstractWindowLayout and for views/components loaded into an existing window, it should subclass AbstractViewLayout and possibly implement DetailEditorSupport. See existing controllers for ideas.
Clone this wiki locally