com.smartgwt.client.widgets

## Class UserFormula

- java.lang.Object
- - com.smartgwt.client.core.JsObject
  - - com.smartgwt.client.core.DataClass
    - - com.smartgwt.client.widgets.UserFormula

-     public class UserFormula
      extends DataClass

  An object representing a user-created and user-modifiable formula, which can be created and edited with a FormulaBuilder either directly or via the `canAddFormulaFields` behavior.

- - ### Field Summary

    - ### Fields inherited from class com.smartgwt.client.core.JsObject

      `jsObj`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserFormula()`
    `UserFormula(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `UserFormula(java.lang.String text)`
    `UserFormula(java.lang.String text, java.util.Map formulaVars)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.util.Map` | `getFormulaVars()` Map from the single-letter capital letters used as formula variables in the `formula` String to the fieldNames these variables should represent in the context where the formula is evaluated.
    `static UserFormula` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `java.lang.String` | `getText()` Formula to be evaluated.
    `void` | `setFormulaVars(java.util.Map formulaVars)` Map from the single-letter capital letters used as formula variables in the `formula` String to the fieldNames these variables should represent in the context where the formula is evaluated.
    `void` | `setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `void` | `setText(java.lang.String text)` Formula to be evaluated.

    - ### Methods inherited from class com.smartgwt.client.core.DataClass

      `doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject`

    - ### Methods inherited from class com.smartgwt.client.core.JsObject

      `equals, hashCode, isCreated, setJsObj`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### UserFormula

          public UserFormula()

    - #### UserFormula

          public UserFormula(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### UserFormula

          public UserFormula(java.lang.String text)

    - #### UserFormula

          public UserFormula(java.lang.String text,
                     java.util.Map formulaVars)

  - ### Method Detail

    - #### getOrCreateRef

          public static UserFormula getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### setJavaScriptObject

          public void setJavaScriptObject(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### setFormulaVars

          public void setFormulaVars(java.util.Map formulaVars)

      Map from the single-letter capital letters used as formula variables in the `formula` String to the fieldNames these variables should represent in the context where the formula is evaluated.
      Parameters:
        `formulaVars` - formulaVars Default value is null

    - #### getFormulaVars

          public java.util.Map getFormulaVars()

      Map from the single-letter capital letters used as formula variables in the `formula` String to the fieldNames these variables should represent in the context where the formula is evaluated.
      Returns:
        Map

    - #### setText

          public void setText(java.lang.String text)

      Formula to be evaluated. All variables used by the formula must be single-letter capital characters (eg A). These are derived from field values for the record in question - see `formulaVars`.

      In addition to these variables, the keyword `record` may be used to refer directly to the record for which the formula is being displayed.

      Parameters:
        `text` - . See `String`. Default value is null

    - #### getText

          public java.lang.String getText()

      Formula to be evaluated. All variables used by the formula must be single-letter capital characters (eg A). These are derived from field values for the record in question - see `formulaVars`.

      In addition to these variables, the keyword `record` may be used to refer directly to the record for which the formula is being displayed.

      Returns:
        . See `String`