Skip to content

tnlx/jfxoo

Repository files navigation

jfxoo

Annotation processor library to generate JavaFX Form during compile time.

Usage

// build.gradle

dependencies {
    implementation 'io.github.tnlx:jfxoo:0.1.0'
    annotationProcessor 'io.github.tnlx:jfxoo:0.1.0'
}

Form

Annotate object with @JFXooForm

@JFXooForm
public class Contact {
  private String name;
  private String phone;
  private String email;
}
// Init the main JFXoo interface
JFXoo jfxoo = JFXoo.init();

JFXooForm<Contact> contactForm = jfxoo.get("Contact", Contact.class);

// Obtain the JavaFX Node to add to the Scene
Node form = contactForm.node();

// Buttons to be displayed at the bottom of the form
contactForm.button("Save", contact -> {});
contactForm.button("Cancel", contact -> {});

Table

Annotate object with @JFXooTable

JFXooTable<Contact> contactTable = jfxoo.table("Contact", Contact.class);

// Obtain the JavaFX Node(s) to add to the Scene
Node node = contactTable.node(); // table and basic control buttons (as VBox)
Node table = contactTable.table(); // only the TableView