Package com.im.ijc.core.api.views
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
IJCWidgetFactory.Provider
Interface, which can look up the IJCWidgetFactory using its ID.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.IJCWidget.DesignerHandle
createWidget(DesignerHandleDescriptor descriptor)
Should create and return a new widget.java.lang.String
getDisplayName()
Supposed to return short descriptive string of a widget(s) created by the implementation of this interface.java.lang.String
getFactoryId()
Identifier which is supposed to be unique among allIJCWidgetFactory
implementations.IJCWidget.DesignerHandle
restoreWidget(DesignerHandleDescriptor descriptor)
Recreates widget using the given descriptor.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.
-
-
-
Method Detail
-
getFactoryId
java.lang.String getFactoryId()
Identifier which is supposed to be unique among allIJCWidgetFactory
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 returnnull
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
-
restoreWidget
IJCWidget.DesignerHandle restoreWidget(DesignerHandleDescriptor descriptor)
Recreates widget using the given descriptor.- Parameters:
descriptor
- descriptor for the widget- Returns:
- widget
-
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 updatedfieldsMapping
- 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 descriptorformBoundFields
- fields bound to any other widget in the form- Returns:
- new settings
-
-