Class HighlightChangesWidgetFactory

java.lang.Object
com.apgar.common.lib.ui.widget.highlightwidget.HighlightChangesWidgetFactory
All Implemented Interfaces:
com.orchestranetworks.ui.form.widget.UIWidgetFactory<com.orchestranetworks.ui.form.widget.UIWidget>

public abstract class HighlightChangesWidgetFactory extends Object implements com.orchestranetworks.ui.form.widget.UIWidgetFactory<com.orchestranetworks.ui.form.widget.UIWidget>
Factory Class for HighlightChangesWidget

This class is defined in the XSD under the field for which the HighlightChangesWidget is drawn.

Parameters ending with "BooleanValue" should be replaced by a Boolean value from the set {"true/false", "t/f", "yes/no", "y/n", "on/off"}.

 <xs:element name="sampleField" minOccurs="0" maxOccurs="1">
     <xs:annotation>
         <xs:documentation xml:lang="en-US">
             <osd:label>Sample Field</osd:label>
         </xs:documentation>
         <xs:appinfo>
             <osd:defaultView>
                 <widget osd:class="com.apgar.common.lib.ui.widget.highlightwidget.HighlightChangesWidgetFactory">
                      <isMaster>isMasterBooleanValue</isMaster>
                      <fkInAssociation>fkInAssociationBooleanValue</fkInAssociation>
                      <isReadOnly>isReadOnlyBooleanValue</isReadOnly>
                      <isReadOnlyOnCondition>isReadOnlyOnConditionBooleanValue</isReadOnlyOnCondition>
                      <readOnlyCondition>readOnlyConditionVerifiedValue</readOnlyCondition>
                      <isCustomWidget>isCustomWidgetBooleanValue</isCustomWidget>
                      <customWidgetModuleName>customWidgetModuleName</customWidgetModuleName>
                      <customWidgetClass>com.project.ui.widget.custominstance.customWidgetClass<customWidgetClass>
                      <customWidgetParams>{customWidgetParams}</customWidgetParams>
                      <isLinkToRecord>isLinkToRecordBooleanValue</isLinkToRecord>
                      <linkToRecordBranch>recordBranch</linkToRecordBranch>
                      <linkToRecordContainer>recordContainer</linkToRecordContainer>
                      <linkToRecordTablePath>./recordTablePath</linkToRecordTablePath>
                      <linkToRecordKeyFieldPath>./linkToRecordKeyFieldPath</linkToRecordKeyFieldPath>
                      <fieldOnChangeJSMethod>fieldOnChangeJSMethod</fieldOnChangeJSMethod>
                 </widget>
             </osd:defaultView>
         </xs:appinfo>
     </xs:annotation>
 </xs:element>
 

For further information, refer to the HighlightChangesWidget class documentation.

Author:
APGAR Consulting
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract String
    getHighlightColorForAssociation(com.orchestranetworks.ui.form.widget.WidgetWriter widgetWriter, com.orchestranetworks.ui.form.widget.WidgetDisplayContext widgetDisplayContext)
    Returns the color used to highlight the field in association.
    abstract String
    getHighlightColorForCreation(com.orchestranetworks.ui.form.widget.WidgetWriter widgetWriter, com.orchestranetworks.ui.form.widget.WidgetDisplayContext widgetDisplayContext)
    Returns the color used to highlight the field during creation.
    abstract String
    getHighlightColorForUpdate(com.orchestranetworks.ui.form.widget.WidgetWriter widgetWriter, com.orchestranetworks.ui.form.widget.WidgetDisplayContext widgetDisplayContext)
    Returns the color used to highlight the field during update.
    abstract com.onwbp.adaptation.AdaptationHome
    getParentHome(com.orchestranetworks.service.Session session, com.orchestranetworks.ui.form.widget.WidgetDisplayContext widgetDisplayContext)
    Returns the dataspace of the field the widget is declared on.
    abstract boolean
    isHighlightColorEBXDefaultColor(com.orchestranetworks.ui.form.widget.WidgetWriter widgetWriter, com.orchestranetworks.ui.form.widget.WidgetDisplayContext widgetDisplayContext)
    Specifies if the default EBX color is used to highlight fields.
    com.orchestranetworks.ui.form.widget.UIWidget
    newInstance(com.orchestranetworks.ui.form.widget.WidgetFactoryContext widgetFactoryContext)
    Creates an instance of the HighlightChangesWidget widget.
    void
    setCustomWidgetClass(String customWidgetClass)
    Sets the customWidgetClass, which specifies the second widget used.
    void
    setCustomWidgetModuleName(String customWidgetModuleName)
    Sets the customWidgetModuleName, which is the module name from which the custom widget class is loaded.
    void
    setCustomWidgetParams(String customWidgetParams)
    Sets the customWidgetParams, which will be used to draw the widget in case of isCustomWidget = true.
    void
    setFieldOnChangeJSMethod(String fieldOnChangeJSMethod)
    Sets the name of the JavaScript Method called on field change.
    void
    setFkInAssociation(String fkInAssociation)
    Sets the fkInAssociation field which detects changes in an association when the PK of the associated records is not a FK to the main record.
    void
    setIsCustomWidget(String isCustomWidget)
    Sets the isCustomWidget, which specifies that a second widget is used.
    void
    setIsLinkToRecord(String isLinkToRecord)
    Sets the isLinkToRecord field which specifies that a "Link to record" widget is drawn.
    void
    setIsMaster(String isMaster)
    Sets the master flag used to compare between the parent and child dataspace to perform the highlighting accordingly.
    void
    setIsReadOnly(String isReadOnly)
    Sets the widget to be read-only.
    void
    setIsReadOnlyOnCondition(String isReadOnlyOnCondition)
    Sets the widget to be read-only if a condition is verified.
    void
    setLinkToRecordBranch(String linkToRecordBranch)
    Sets the linkToRecordBranch field which is the target dataspace of the record to be linked through the widget.
    void
    setLinkToRecordContainer(String linkToRecordContainer)
    Sets the linkToRecordContainer field which is the target dataset of the record to be linked through the widget.
    void
    setLinkToRecordKeyFieldPath(String linkToRecordKeyFieldPath)
    Sets the linkToRecordKeyFieldPath field which is a field of the target record to be linked through the widget based on this field's value.
    void
    setLinkToRecordTablePath(String linkToRecordTablePath)
    Sets the linkToRecordTablePath field which is the target table path of the record to be linked through the widget.
    void
    setReadOnlyCondition(String readOnlyCondition)
    Sets the condition for setting the widget to be read-only.
    void
    setReadOnlyfieldToCheck(String readOnlyfieldToCheck)
    Sets the field to be checked, if it meets the isReadOnlyOnCondition, the widget will be read-only.
    void
    setup(com.orchestranetworks.ui.form.widget.WidgetFactorySetupContext setupContext)
     
    abstract boolean
    shouldDrawDefaultWidget(com.orchestranetworks.ui.form.widget.WidgetWriter widgetWriter, com.orchestranetworks.ui.form.widget.WidgetDisplayContext widgetDisplayContext)
    Specifies if the default widget is drawn or not.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HighlightChangesWidgetFactory

      public HighlightChangesWidgetFactory()
  • Method Details

    • newInstance

      public com.orchestranetworks.ui.form.widget.UIWidget newInstance(com.orchestranetworks.ui.form.widget.WidgetFactoryContext widgetFactoryContext)
      Creates an instance of the HighlightChangesWidget widget.
      Specified by:
      newInstance in interface com.orchestranetworks.ui.form.widget.UIWidgetFactory<com.orchestranetworks.ui.form.widget.UIWidget>
    • setup

      public void setup(com.orchestranetworks.ui.form.widget.WidgetFactorySetupContext setupContext)
      Specified by:
      setup in interface com.orchestranetworks.ui.form.widget.UIWidgetFactory<com.orchestranetworks.ui.form.widget.UIWidget>
    • shouldDrawDefaultWidget

      public abstract boolean shouldDrawDefaultWidget(com.orchestranetworks.ui.form.widget.WidgetWriter widgetWriter, com.orchestranetworks.ui.form.widget.WidgetDisplayContext widgetDisplayContext)
      Specifies if the default widget is drawn or not.
      Parameters:
      widgetWriter - WidgetWriter
      widgetDisplayContext - WidgetDisplayContext
      Returns:
      true if the default widget is drawn
    • isHighlightColorEBXDefaultColor

      public abstract boolean isHighlightColorEBXDefaultColor(com.orchestranetworks.ui.form.widget.WidgetWriter widgetWriter, com.orchestranetworks.ui.form.widget.WidgetDisplayContext widgetDisplayContext)
      Specifies if the default EBX color is used to highlight fields.
      Parameters:
      widgetWriter - WidgetWriter
      widgetDisplayContext - WidgetDisplayContext
      Returns:
      true if default EBX color is used to highlight
    • getHighlightColorForCreation

      public abstract String getHighlightColorForCreation(com.orchestranetworks.ui.form.widget.WidgetWriter widgetWriter, com.orchestranetworks.ui.form.widget.WidgetDisplayContext widgetDisplayContext)
      Returns the color used to highlight the field during creation.
      Parameters:
      widgetWriter - WidgetWriter
      widgetDisplayContext - WidgetDisplayContext
      Returns:
      color code for highlight in creation as a String
    • getHighlightColorForUpdate

      public abstract String getHighlightColorForUpdate(com.orchestranetworks.ui.form.widget.WidgetWriter widgetWriter, com.orchestranetworks.ui.form.widget.WidgetDisplayContext widgetDisplayContext)
      Returns the color used to highlight the field during update.
      Parameters:
      widgetWriter - WidgetWriter
      widgetDisplayContext - WidgetDisplayContext
      Returns:
      color code for highlight in case of update as a String
    • getHighlightColorForAssociation

      public abstract String getHighlightColorForAssociation(com.orchestranetworks.ui.form.widget.WidgetWriter widgetWriter, com.orchestranetworks.ui.form.widget.WidgetDisplayContext widgetDisplayContext)
      Returns the color used to highlight the field in association.
      Parameters:
      widgetWriter - WidgetWriter
      widgetDisplayContext - WidgetDisplayContext
      Returns:
      color code for highlight in case of association as a String
    • getParentHome

      public abstract com.onwbp.adaptation.AdaptationHome getParentHome(com.orchestranetworks.service.Session session, com.orchestranetworks.ui.form.widget.WidgetDisplayContext widgetDisplayContext)
      Returns the dataspace of the field the widget is declared on.
      Parameters:
      session - Session
      widgetDisplayContext - WidgetDisplayContext
      Returns:
      dataspace where widget is declared
    • setIsMaster

      public void setIsMaster(String isMaster)
      Sets the master flag used to compare between the parent and child dataspace to perform the highlighting accordingly.
      Parameters:
      isMaster - String with Boolean value ("true/false", "t/f", "yes/no", "y/n", "on/off")
    • setFkInAssociation

      public void setFkInAssociation(String fkInAssociation)
      Sets the fkInAssociation field which detects changes in an association when the PK of the associated records is not a FK to the main record.
      Parameters:
      fkInAssociation - String with Boolean value ("true/false", "t/f", "yes/no", "y/n", "on/off")
    • setIsReadOnly

      public void setIsReadOnly(String isReadOnly)
      Sets the widget to be read-only.
      Parameters:
      isReadOnly - String with Boolean value ("true/false", "t/f", "yes/no", "y/n", "on/off")
    • setIsReadOnlyOnCondition

      public void setIsReadOnlyOnCondition(String isReadOnlyOnCondition)
      Sets the widget to be read-only if a condition is verified.
      Parameters:
      isReadOnlyOnCondition - String with Boolean value ("true/false", "t/f", "yes/no", "y/n", "on/off")
    • setReadOnlyfieldToCheck

      public void setReadOnlyfieldToCheck(String readOnlyfieldToCheck)
      Sets the field to be checked, if it meets the isReadOnlyOnCondition, the widget will be read-only.
      Parameters:
      readOnlyfieldToCheck - Path of field to check
    • setReadOnlyCondition

      public void setReadOnlyCondition(String readOnlyCondition)
      Sets the condition for setting the widget to be read-only.
      Parameters:
      readOnlyCondition - String value which the readOnlyfieldToCheck value will be compared to.
    • setIsCustomWidget

      public void setIsCustomWidget(String isCustomWidget)
      Sets the isCustomWidget, which specifies that a second widget is used.
      Parameters:
      isCustomWidget - String with Boolean value ("true/false", "t/f", "yes/no", "y/n", "on/off")
    • setCustomWidgetClass

      public void setCustomWidgetClass(String customWidgetClass)
      Sets the customWidgetClass, which specifies the second widget used.
      Parameters:
      customWidgetClass - Class in binary name format
    • setCustomWidgetModuleName

      public void setCustomWidgetModuleName(String customWidgetModuleName)
      Sets the customWidgetModuleName, which is the module name from which the custom widget class is loaded.
      Parameters:
      customWidgetModuleName - Module Name as String
    • setCustomWidgetParams

      public void setCustomWidgetParams(String customWidgetParams)
      Sets the customWidgetParams, which will be used to draw the widget in case of isCustomWidget = true.
      Parameters:
      customWidgetParams - Parameters as JSON String.
    • setIsLinkToRecord

      public void setIsLinkToRecord(String isLinkToRecord)
      Sets the isLinkToRecord field which specifies that a "Link to record" widget is drawn.
      Parameters:
      isLinkToRecord - String with Boolean value ("true/false", "t/f", "yes/no", "y/n", "on/off")
    • setLinkToRecordBranch

      public void setLinkToRecordBranch(String linkToRecordBranch)
      Sets the linkToRecordBranch field which is the target dataspace of the record to be linked through the widget.
      Parameters:
      linkToRecordBranch - Record Branch name as a String
    • setLinkToRecordContainer

      public void setLinkToRecordContainer(String linkToRecordContainer)
      Sets the linkToRecordContainer field which is the target dataset of the record to be linked through the widget.
      Parameters:
      linkToRecordContainer - Record Container name as a String
    • setLinkToRecordTablePath

      public void setLinkToRecordTablePath(String linkToRecordTablePath)
      Sets the linkToRecordTablePath field which is the target table path of the record to be linked through the widget.
      Parameters:
      linkToRecordTablePath - Record Table path as a String
    • setLinkToRecordKeyFieldPath

      public void setLinkToRecordKeyFieldPath(String linkToRecordKeyFieldPath)
      Sets the linkToRecordKeyFieldPath field which is a field of the target record to be linked through the widget based on this field's value.
      Parameters:
      linkToRecordKeyFieldPath - Record Key field path as a String
    • setFieldOnChangeJSMethod

      public void setFieldOnChangeJSMethod(String fieldOnChangeJSMethod)
      Sets the name of the JavaScript Method called on field change.
      Parameters:
      fieldOnChangeJSMethod - String name of the JavaScript Method for field change