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

templates.JavaFXassociations.stg Maven / Gradle / Ivy

There is a newer version: 1.6.2
Show newest version


roleAttrDecl(roleName,roleType,toMany,otherClassName) ::=
<<

   private SimpleListProperty\<  >  = _init();

   private ObjectProperty\<  >  = _init();

>>

propertyDecl(roleName) ::=
<<   public static final String PROPERTY_ = "";>>

initMethod(roleName,toMany,myClassName,otherClassName,otherRoleName,otherToMany) ::=
<<

   private SimpleListProperty\<  > _init()
   {
      SimpleListProperty\<  > result = new SimpleListProperty(javafx.collections.FXCollections.observableArrayList());
      result.addListener((javafx.collections.ListChangeListener\ >) change -> {
         while (change.next())
         {
            java.util.List\ > removed = change.getRemoved();
            for (  value : removed)
            {
               value.;
               firePropertyChange("", value, null);
            }
            for ( value : change.getAddedSubList())
            {
               value.(this);
               firePropertyChange("", null, value);
            }
         }
      });
      return result;
   }

   private ObjectProperty\<  > _init()
   {
      ObjectProperty\<  > result = new SimpleObjectProperty\<>();
      result.addListener((observable, oldValue, newValue) ->
      {
         if (oldValue != null) oldValue.;
         if (newValue != null) newValue.(.this);
         firePropertyChange("", oldValue, newValue);
      });
      return result;
   }

>>


getMethod(roleName,toMany,otherClassName,roleType) ::=
<<

   public \<  > get()
   {
      return ;
   }

   public  get()
   {
      return .getValue();
   }

>>


propertyMethod(roleName,otherClassName) ::=
<<
   public ObjectProperty\<  > Property()
   {
      return ;
   }
>>


property(toMany) ::=
<%

SimpleListProperty

ObjectProperty

%>


setMethod(roleName,toMany,myClassName,otherClassName,otherRoleName,otherToMany,roleType) ::=
<<

   public  with( value)
   {
      if (this.get().contains(value)) return this;
      this.get().add(value);
      return this;
   }

   public  set( value)
   {
      if (value == this..getValue()) return this;
      .setValue(value);
      return this;
   }

>>


withoutMethod(roleName,toMany,myClassName,otherClassName,otherRoleName,otherToMany,roleType) ::=
<<
   public  without( value)
   {
      this.get().remove(value);
      return this;
   }
>>


withoutTypeThis(toMany,otherRoleName,myClassName) ::=
<%

   without(.this)

   set(null)

%>


withoutThis(toMany,otherRoleName) ::=
<%

   without(this)

   set(null)

%>


prefix(toMany) ::=
<%

   with

   set

%>

cap(n) ::=
<%

%>





© 2015 - 2025 Weber Informatics LLC | Privacy Policy