Class AbstractAsynchronousCustomFeature

    • Constructor Detail

      • AbstractAsynchronousCustomFeature

        public AbstractAsynchronousCustomFeature​(IFeatureProvider fp)
    • Method Detail

      • execute

        protected abstract void execute​(ICustomContext context,
                                        org.eclipse.core.runtime.IProgressMonitor monitor)
        Concrete code to execute. Sub-classes should use the given monitor correctly: create tasks (and eventually sub-tasks), notify for worked and done tasks and check if user cancelled the task.
        Parameters:
        context - The CustomFeature context
        monitor - The monitor used to manage progress bar and Job cancellation
      • beforeJobExecution

        protected void beforeJobExecution()
        Callback executed just before job scheduling; called in the feature execution thread. Default implementation is empty.
      • afterJobExecution

        protected void afterJobExecution()
        Callback executed immediately after job execution in the background job execution thread. Default implementation is empty.
      • configureJob

        protected void configureJob​(org.eclipse.core.runtime.jobs.Job job)
        Initialize parameters of the given Job
        Parameters:
        job - The Job instance to configure
      • hasDoneChanges

        public final boolean hasDoneChanges()
        The default implementation returns false in any case. This is usually the desired return value, because this method will be queried already before the asynchronous feature will be executed ( execute(ICustomContext, IProgressMonitor) is called). Returning true here would mean that users could already undo the feature while it is still being executed; this would mean also canceling the a running job. Because of potentially strange effects and complexity this is not possible.
        Specified by:
        hasDoneChanges in interface IFeature
        Overrides:
        hasDoneChanges in class AbstractFeature
        Returns:
        Always false