Class SynchronizationOperation

    • Constructor Detail

      • SynchronizationOperation

        protected SynchronizationOperation​(ISynchronizePageConfiguration configuration,
                                           java.lang.Object[] elements)
        Create a synchronize operation that operations on the given elements
        Parameters:
        configuration - the configuration for the page the operation is associated with
        elements - the elements to be operated on
    • Method Detail

      • getConfiguration

        public ISynchronizePageConfiguration getConfiguration()
        Return the configuration for the page from which this operation was launched.
        Returns:
        the configuration for the page from which this operation was launched
      • getContext

        protected ISynchronizationContext getContext()
        Return the synchronization context associated with this action.
        Returns:
        the synchronization context associated with this action
      • getElements

        public java.lang.Object[] getElements()
        Return the model elements that are the target of this operation.
        Returns:
        the model elements that are the target of this operation
      • shouldRun

        public boolean shouldRun()
        Make shouldRun public so the result can be used to provide handler enablement
        Overrides:
        shouldRun in class TeamOperation
        Returns:
        whether the operation should be run.
      • getSaveable

        public SaveableComparison getSaveable()
        Return the saveable that this operation will write its results to or null if the operation does not buffer its results. By default, null is returned but subclasses may override.
        Returns:
        the saveable that this operation will write its results to or null
      • run

        public final void run​(IProgressMonitor monitor)
                       throws java.lang.reflect.InvocationTargetException,
                              java.lang.InterruptedException
        Description copied from interface: IRunnableWithProgress
        Runs this operation. Progress should be reported to the given progress monitor. This method is usually invoked by an IRunnableContext's run method, which supplies the progress monitor. A request to cancel the operation should be honored and acknowledged by throwing InterruptedException.
        Parameters:
        monitor - the progress monitor to use to display progress and receive requests for cancelation
        Throws:
        java.lang.reflect.InvocationTargetException - if the run method must propagate a checked exception, it should wrap it inside an InvocationTargetException; runtime exceptions are automatically wrapped in an InvocationTargetException by the calling context
        java.lang.InterruptedException - if the operation detects a request to cancel, using IProgressMonitor.isCanceled(), it should exit by throwing InterruptedException
        See Also:
        IRunnableContext.run(boolean, boolean, org.eclipse.jface.operation.IRunnableWithProgress)
      • execute

        protected abstract void execute​(IProgressMonitor monitor)
                                 throws java.lang.reflect.InvocationTargetException,
                                        java.lang.InterruptedException
        Execute the operation. Subclasses should implement the operations behavior in the execute method. Clients should call either TeamOperation.run() or run(IProgressMonitor) to invoke the operation.
        Parameters:
        monitor - a progress monitor
        Throws:
        java.lang.reflect.InvocationTargetException - if an error occurs
        java.lang.InterruptedException - if operation is interrupted