Interface IJCWidgetFactory<W extends com.chemaxon.ijc.form.api.AbstractWidget>

  • Type Parameters:
    W - FormsModel widget

    public interface IJCWidgetFactory<W extends com.chemaxon.ijc.form.api.AbstractWidget>
    Factory responsible for creation and restoring of one type of IJC widget. The creation mechanism itself might create different widgets of the same type. E.g. chart factory can create scatter plot, histogram, parallel coordinate plot which might be deemed as different widgets of the same, chart type.
    • Method Detail

      • getFactoryId

        java.lang.String getFactoryId()
        Identifier which is supposed to be unique among all IJCWidgetFactory implementations. It is mainly used by IJC persistence mechanism.
        Returns:
        unique identifier.
      • getDisplayName

        java.lang.String getDisplayName()
        Supposed to return short descriptive string of a widget(s) created by the implementation of this interface. It will appear for example in the context menu of the IJC form view or in the tooltip of form view widget toolbar.
        Returns:
        the display name
      • createWidget

        IJCWidget.DesignerHandle createWidget​(DesignerHandleDescriptor descriptor)
        Should create and return a new widget. It might return null if creation process fails. E.g. when wizard for creating a new widget was cancelled by user.
        Parameters:
        descriptor - descriptor for the widget
        Returns:
        widget or null
      • updateWidgetFields

        void updateWidgetFields​(W widget,
                                java.util.Map<? extends com.im.df.api.ddl.DFField,​? extends com.im.df.api.ddl.DFField> fieldsMapping)
        Update fields in widget object. This method is used for example when widget is copied from one form to another and settings contain links to field(s). When source and target forms belong to different entities (datatrees) then fields must be mapped. The fieldsMapping map specifies how source fields are mapped to fields in target datatree.
        Parameters:
        widget - the widget settings to be updated
        fieldsMapping - Mapping of fields from original field to new
        Since:
        18.23.0
      • askRebind

        Optional<DesignerHandleDescriptor> askRebind​(DesignerHandleDescriptor descriptor,
                                                     java.util.List<? extends com.im.df.api.ddl.DFField> formBoundFields)
        Ask user to select new fields (and potentially settings) for the widget.
        Parameters:
        descriptor - current widget descriptor
        formBoundFields - fields bound to any other widget in the form
        Returns:
        new settings