Module org.autogui
Package org.autogui

Annotation Interface GuiNotifierSetter


@Retention(RUNTIME) @Target(METHOD) public @interface GuiNotifierSetter
indicates a setter method that receives a notifier for the target member
     @GuiIncluded
     class C {
         @GuiIncluded public int value;
         @GuiIncluded public String name;

         Runnable valueNotifier;
         Runnable nameNotifier;
         Runnable selfNotifier;

         {
             new Thread(() -> {
                while (true) {
                  if (valueNotifier != null) valueNotifier.run();
                  if (nameNotifier != null) nameNotifier.run();
                  if (selfNotifier != null) selfNotifier.run();
                  sleep();
                }
             }).start();
         }

         //updater for the pane of the property "value" from the setter name "set...Notifier"
         @GuiNotifierSetter
         public void setValueNotifier(Runnable notifier) {
             this.valueNotifier = notifier;
         }

         //updater for the pane of the property "name"
         @GuiNotifierSetter(target="name")
         public void setNameUpdater(Runnable notifier) {
            this.nameNotifier = notifier;
         }

         //updater for the pane of the entire pane of the C object
         @GuiNotifierSetter
         public void setNotifier(Runnable notifier) {
            this.selfNotifier = notifier;
         }

         ...
     }
 
Since:
1.2
  • Field Details

  • Element Details

    • target

      String target
      Returns:
      the name of the target of notifying, can be another property name (starting with a small-case letter) or TARGET_SELF meaning the owner type itself, TARGET_FROM_NAME meaning that the name is determined by the name of the attached setter "setTargetNotifier" as default, or TARGET_ROOT meaning the entire pane from the root.
      Default:
      "-"