Class HighlightChangesWidgetFactory

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

public abstract class HighlightChangesWidgetFactory extends Object implements UIWidgetFactory<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 Details

    • HighlightChangesWidgetFactory

      public HighlightChangesWidgetFactory()
  • Method Details

    • newInstance

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

      public void setup(WidgetFactorySetupContext setupContext)
      Specified by:
      setup in interface UIWidgetFactory<UIWidget>
    • shouldDrawDefaultWidget

      public abstract boolean shouldDrawDefaultWidget(WidgetWriter widgetWriter, 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(WidgetWriter widgetWriter, 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(WidgetWriter widgetWriter, 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(WidgetWriter widgetWriter, 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(WidgetWriter widgetWriter, 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 AdaptationHome getParentHome(Session session, 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