@Retention(value=RUNTIME)
@Target(value=TYPE)
public @interface ViewController
Annotation for a MVC controller. This annotation will define the view (FXML file or java class)
this controller is made for. You don't need to use this annotation because
the API is designed using a convention over configuration approach: If you
have a fxml file "master.fxml" you can create a MasterController.java
controller in the same package and the controller API will use this
controller for the fxml. To create a controller/view pair you need to use the
ViewFactory.
An example of a simple controller:
@FXMLController("Details.fxml")
public class DetailViewController {
*
@FXML
private TextField myTextfield;
* @FXML
private Button backButton;
@PostConstruct
public void init() {
myTextfield.setText("Hello!");
}
}
| ?????? | ??????? |
|---|---|
java.lang.String |
iconPath
Defines the icon path for the view.
|
java.lang.Class<? extends javafx.scene.Node> |
root
Defines a Java class that extends Node.
|
java.lang.String |
title
Defines the title of the view.
|
java.lang.String |
value
Defines the name of the fxml files that should be used with the annotated
controller.
|
public abstract java.lang.String value
public abstract java.lang.String title
Tab for example.public abstract java.lang.String iconPath
Tab for example.public abstract java.lang.Class<? extends javafx.scene.Node> root
NullNode
a new instance of the class will be created and used as the view. Therefore the class needs a default constructor.
In later version maybe additional constructors (for ressource bundle support, etc.) will be supported.
In the view class the ViewNode annotation can be used.