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

io.datafx.controller.ViewNode Maven / Gradle / Ivy

There is a newer version: 8.0.7
Show newest version
package io.datafx.controller;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation to define UI elements. The annotation can be used in a controller class and in a view class.
 * It can only be used for fields that define a {@link javafx.scene.Node} instance. Normally it will be used
 * to annotate children of the view:
 * 
 *     @ViewController
 *     public class SimpleController {
 *
 *        @ViewNode
 *        private Button myButton;
 *
 *     }
 * 
 *
 * By using the annotation in the view class the annotated view element (node) will get an id. If the {@link #value()} of the
 * annotation is != "" the {@link #value()} will be used. Otherwise the name of the field will be used as the id of the node.
 *
 * By using the annotation in the controller class the annotated view element (node) will be injected. To find the matching
 * node the {@link #value()} of the annotation will be used. If the {@link value} is == "" the name of the field will be
 * used as the id of the node.
 *
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface ViewNode {

    String value() default "";

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy