Interface IFormExtensionService


  • public interface IFormExtensionService
    Form extension suppliment service
    • Method Detail

      • resetExtensionFlag

        void resetExtensionFlag​(Object object)
        Resets extension-belonging flag in default value.

        This method will do nothing if the given argument does not relate to IExtensionProject

        Parameters:
        object - some related to the form object, can't be null
      • proceedFormToExtensionPostAction

        void proceedFormToExtensionPostAction​(Form extForm)
        Proceed required post-action after form adoptation. (Add to extension case)
        Parameters:
        extForm - the adopted extension form, can't be null
      • proceedFormMergePostAction

        void proceedFormMergePostAction​(Form extForm)
        Proceed required post-action after form merge operation.
        Parameters:
        extForm - the merged form, can't be null
      • markAsBorrowedObject

        void markAsBorrowedObject​(Object object)
        Marks the given form object as extension-belonging for IExtensionProject

        This method will do nothing if the given argument does not relate to IExtensionProject

        Parameters:
        object - some related to the form object, can't be null
      • markAsBorrowedParentObject

        void markAsBorrowedParentObject​(org.eclipse.emf.ecore.EObject eObject)
        Marks the given form object's nearest acceptable parent as extension-belonging for IExtensionProject

        This method will do nothing if the given argument does not relate to IExtensionProject

        Parameters:
        eObject - some related to the form EObject, can't be null
      • markAsChangedObject

        void markAsChangedObject​(Object object,
                                 boolean isManualModified)
        Marks the given form object as changed object according to the base form snapshot.

        This method will do nothing if the given argument does not relate to IExtensionProject

        Parameters:
        object - some related to the form object, can't be null
        isManualModified - manual modification flag. Should be true if the relative form object is changed by direct user operation.
      • isPureExtensionObject

        boolean isPureExtensionObject​(Object object,
                                      Form extForm)
        Returns true if the given object has been created in the extension. Returns false for all not-extension form and it's containments.
        Parameters:
        object - some related to the form object, can't be null
        extForm - the extension form, can't be null
        Returns:
        true if the given object has been created in the extension.
      • isUnchangedExtensionObject

        boolean isUnchangedExtensionObject​(Object object)
        Checks that current object has been changed in comparison with base form snapshot.
        Parameters:
        object - some form object, can't be null
        Returns:
        true if current object remains unchanged
      • isExtensionAdopted

        boolean isExtensionAdopted​(Object object)
        Returns true if object belongs to the form extension and this form is adopted. Non-adopted forms should be ignored by this service.

        Related form must have real .baseForm (form snapshot) instance. Proxy objects are not allowed.

        Parameters:
        object - some related to the form object, can't be null
        Returns:
        true if object belongs to the extension
        Throws:
        IllegalArgumentException - in case when determining object's project is impossible
      • computeAllPureExtensionObjects

        void computeAllPureExtensionObjects​(Form extForm,
                                            Form baseForm)
        Computes property of extension belonging for each object in form extension extForm relative to shapshot baseForm.
        Parameters:
        extForm - the extension form model, can't be null
        baseForm - corresponding base form snapshot, can't be null
        See Also:
        ExtensionAdoptedProperty.getFromBase()
      • rebuildExtensionForm

        void rebuildExtensionForm​(Form extForm,
                                  Form baseForm)
        Adds form's objects from baseForm snapshot to the extForm. This method designed to be executed during DD stage.

        This method will do nothing if the given argument does not relate to IExtensionProject

        Parameters:
        extForm - the extension form model, can't be null
        baseForm - corresponding base form snapshot, can't be null
      • isExtensionBelongingObject

        boolean isExtensionBelongingObject​(Object object)
        Returns true if object has been created from the extension or adopted to the extension by user.
        Parameters:
        object - some object related to the form object, can't be null
        Returns:
        true if object has been created from the extension or adopted to the extension by user
      • isExtensionBelongingUnderlyingObject

        boolean isExtensionBelongingUnderlyingObject​(DataItem dataItem)
        Returns true if underlying object (Command or FormAttribute) of form data item has been created from the extension or adopted to the extension by user.
        Parameters:
        dataItem - some form data item (either Button or FormField), can't be null
        Returns:
        true if underlying object has been created from the extension or adopted to the extension by user
      • filterExtensionBelongingObject

        void filterExtensionBelongingObject​(Form extForm,
                                            IBmModel model,
                                            IBmObject bmObject)
        Removes all non-extension form objects.

        This method will do nothing if the given argument does not relate to IExtensionProject

        Parameters:
        extForm - the extension form model, can't be null
        model - the corresponding IBmModel, can't be null
        bmObject - alive IBmObject. Need to determine form extension, can't be null
      • addAdoptChangeListener

        void addAdoptChangeListener​(IAdoptEventListener listener)
        Adds adopt process status listener.
        Parameters:
        listener - event listener, cannot be null
      • fireAdoptEvent

        void fireAdoptEvent​(Form form,
                            AdoptStatus status)
        Trigger event on adopt process
        Parameters:
        form - form to be adopted, cannot be null
        status - adopt process status, cannot be null
      • removeAdoptChangeListener

        void removeAdoptChangeListener​(IAdoptEventListener listener)
        Remove event listener
        Parameters:
        listener - the event listener to remove (not null)
      • prepareToExport

        <T extends org.eclipse.emf.ecore.EObject> T prepareToExport​(T objectToExport,
                                                                    Form form)
        Prepares object to export operation.
        Type Parameters:
        T - export object type
        Parameters:
        objectToExport - object to export, cannot be null
        form - the form, cannot be null
        Returns:
        prepared to export object, never null
      • getExcludedFeaturesForExport

        Collection<org.eclipse.emf.ecore.EStructuralFeature> getExcludedFeaturesForExport​(org.eclipse.emf.ecore.EObject objectToExport,
                                                                                          Form form)
        Returns collection of export excluded features for given eObject.
        Parameters:
        objectToExport - object to export, cannot be null
        form - the form, cannot be null
        Returns:
        collection of excluded features, never null
      • getChangedFormItemFeatures

        Collection<org.eclipse.emf.ecore.EStructuralFeature> getChangedFormItemFeatures​(FormItem formItem)
        Returns collection of all unchanged features of the form item. The given form item should be from adopted form.
        Parameters:
        formItem - the form item, cannot be null
        Returns:
        collection of all unchanged features of the form item or empty collection for not adopted or non-extension form, never null
      • isFormItemPositionChanged

        boolean isFormItemPositionChanged​(FormItem formItem)
        Returns true if the form item position has been changed in comparison with the form snapshot.
        Parameters:
        formItem - the form item , cannot be null
        Returns:
        true if the form item position has been changed