Package snap.view

Class Binding

java.lang.Object
snap.view.Binding
All Implemented Interfaces:
Cloneable, XMLArchiver.Archivable

public class Binding extends Object implements Cloneable, XMLArchiver.Archivable
This class maps a UI node value to a model key value (some kind of display object like a Swing component value or an RMShape size).
  • Constructor Details

    • Binding

      public Binding()
      Creates a new binding.
    • Binding

      public Binding(String aPropName, String aKey)
      Creates a new binding for property name and key.
  • Method Details

    • getView

      public Object getView()
      Returns the UI view.
    • setView

      public void setView(Object anObj)
      Sets the UI view.
    • getView

      public <T> T getView(Class<T> aClass)
      Returns the UI view.
    • getPropName

      public String getPropName()
      Returns the property name.
    • setPropName

      public void setPropName(String aPropertyName)
      Sets the property name.
    • getKey

      public String getKey()
      Returns the key that is used to get the property value from the bound object.
    • setKey

      public void setKey(String aKey)
      Sets the key that is used to get the property value from the bound object.
    • clone

      public Binding clone()
      Standard clone implementation.
      Overrides:
      clone in class Object
    • toXML

      public XMLElement toXML(XMLArchiver anArchiver)
      XML archival.
      Specified by:
      toXML in interface XMLArchiver.Archivable
    • fromXML

      public Binding fromXML(XMLArchiver anArchiver, XMLElement anElement)
      XML unarchival.
      Specified by:
      fromXML in interface XMLArchiver.Archivable
    • toString

      public String toString()
      Returns a string representation.
      Overrides:
      toString in class Object