Class SingleVariantModelBasicFix<OC extends org.eclipse.emf.ecore.EObject>

    • Constructor Detail

      • SingleVariantModelBasicFix

        protected SingleVariantModelBasicFix()
      • SingleVariantModelBasicFix

        protected SingleVariantModelBasicFix​(Class<OC> objectClass)
        Constructs an instance of the fix. The provided class used to filter the applications of this fix (only matching model classes are being processed by this fix).
        Parameters:
        objectClass - The class filter. May not be null
    • Method Detail

      • describeChanges

        public final FixVariantDescriptor describeChanges​(BasicModelFixContext context,
                                                          IFixSession session)
        Description copied from interface: IFixVariant
        Gets the quick fix variant descriptor
        Parameters:
        context - the context, cannot be null
        session - the session, cannot be null
        Returns:
        fix variant descriptor, never null
      • getRequiredContextType

        public final Class<BasicModelFixContext> getRequiredContextType()
        Description copied from interface: IFix
        Gets the required context type
        Returns:
        The type of the context that is required by the fix variant to work. May not be null
      • onRegistration

        public final void onRegistration​(FixDescriptor registrationContext)
        Description copied from interface: IFix
        This method is being called by the fix engine during the initialization phase. The developer may register additional fix entitier, like context factories, fix change processors, preview providers which are specific only to this fix
        Parameters:
        registrationContext - The descriptor of the fix. A fix developer should use it to register fix specific components. May not be null
      • prepareChanges

        public final Collection<IFixChange> prepareChanges​(BasicModelFixContext context,
                                                           IFixSession session)
        Description copied from interface: IFixVariant
        Prepares the changes to form the fix
        Parameters:
        context - The fix context. May not be null
        Returns:
        The collection of prepared fix changes (if applicable). Never null. May be empty
      • configureFix

        protected void configureFix​(SingleVariantModelBasicFix.FixConfigurer configurer)
        Configures the fix. The developer could provide descreptive/filtering information for the fix here
        Parameters:
        configurer - The configurer of the fix. May not be null
      • applyChanges

        protected abstract void applyChanges​(OC modelObject,
                                             org.eclipse.emf.ecore.EStructuralFeature targetFeature,
                                             BasicModelFixContext context,
                                             IFixSession session)
        Apply the changes of this fix to the target model data. It's up to a fix developer to decide what the logic is
        Parameters:
        modelObject - The model object being a target of an original issue. May not be null
        targetFeature - The target feature. May be null
        context - The fix context. May not be null
        session - The fix session. May not be null