org.eclipse.emf.emfstore.internal.client.ui.controller
Class UIUpdateProjectController

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.ui.common.MonitoredEMFStoreAction<T>
      extended by org.eclipse.emf.emfstore.internal.client.ui.controller.AbstractEMFStoreUIController<ESPrimaryVersionSpec>
          extended by org.eclipse.emf.emfstore.internal.client.ui.controller.UIUpdateProjectController
All Implemented Interfaces:
ESUpdateCallback

public class UIUpdateProjectController
extends AbstractEMFStoreUIController<ESPrimaryVersionSpec>
implements ESUpdateCallback

UI controller for performing a paged update.

Author:
emueller

Field Summary
 
Fields inherited from interface org.eclipse.emf.emfstore.client.callbacks.ESUpdateCallback
NOCALLBACK
 
Constructor Summary
UIUpdateProjectController(org.eclipse.swt.widgets.Shell shell, ESLocalProject localProject)
          Constructor.
UIUpdateProjectController(org.eclipse.swt.widgets.Shell shell, ESLocalProject localProject, ESVersionSpec versionSpec)
          Constructor.
UIUpdateProjectController(org.eclipse.swt.widgets.Shell shell, ESLocalProject localProject, int maxChanges)
          Constructor.
 
Method Summary
 boolean conflictOccurred(ESConflictSet changeConflict, org.eclipse.core.runtime.IProgressMonitor monitor)
          Called when local and remote changes overlap.
 ESPrimaryVersionSpec doRun(org.eclipse.core.runtime.IProgressMonitor monitor)
          The actual behavior that should be performed when the MonitoredEMFStoreAction.execute() is called.
Must be implemented by clients.
 boolean inspectChanges(ESLocalProject localProject, List<ESChangePackage> changePackages, ESModelElementIdToEObjectMapping idToEObjectMapping)
          Called right before the changes get applied upon the project space.
 void noChangesOnServer()
          Called when no remote changes are available.
 
Methods inherited from class org.eclipse.emf.emfstore.internal.client.ui.controller.AbstractEMFStoreUIController
confirm, getShell, setShell
 
Methods inherited from class org.eclipse.emf.emfstore.internal.client.ui.common.MonitoredEMFStoreAction
afterRun, execute, executeSub, isForked, preRun
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UIUpdateProjectController

public UIUpdateProjectController(org.eclipse.swt.widgets.Shell shell,
                                 ESLocalProject localProject)
Constructor.

Parameters:
shell - the Shell that will be used during the update
localProject - the ESLocalProject that should get updated

UIUpdateProjectController

public UIUpdateProjectController(org.eclipse.swt.widgets.Shell shell,
                                 ESLocalProject localProject,
                                 ESVersionSpec versionSpec)
Constructor.

Parameters:
shell - the Shell that will be used during the update
localProject - the ESLocalProject that should get updated
versionSpec - the version to update to

UIUpdateProjectController

public UIUpdateProjectController(org.eclipse.swt.widgets.Shell shell,
                                 ESLocalProject localProject,
                                 int maxChanges)
Constructor.

Parameters:
shell - the Shell that will be used during the update
localProject - the ESLocalProject that should get updated
maxChanges - the number of maximally allowed changes
Method Detail

noChangesOnServer

public void noChangesOnServer()
Called when no remote changes are available.

Specified by:
noChangesOnServer in interface ESUpdateCallback
See Also:
ESUpdateCallback.noChangesOnServer()

conflictOccurred

public boolean conflictOccurred(ESConflictSet changeConflict,
                                org.eclipse.core.runtime.IProgressMonitor monitor)
Called when local and remote changes overlap.

Specified by:
conflictOccurred in interface ESUpdateCallback
Parameters:
changeConflict - the ESConflictSetImpl containing the changes that led to the conflict
monitor - an IProgressMonitor to report on progress
Returns:
true, if the conflict has been resolved, false otherwise
See Also:
ESUpdateCallback.conflictOccurred(org.eclipse.emf.emfstore.server.ESConflictSet, org.eclipse.core.runtime.IProgressMonitor)

inspectChanges

public boolean inspectChanges(ESLocalProject localProject,
                              List<ESChangePackage> changePackages,
                              ESModelElementIdToEObjectMapping idToEObjectMapping)
Called right before the changes get applied upon the project space.

Specified by:
inspectChanges in interface ESUpdateCallback
Parameters:
localProject - the ESLocalProject being updated
changePackages - a list of ESChangePackages that will get applied upon the project
idToEObjectMapping - a mapping from IDs to EObjects and vice versa. Contains all IDs of model elements involved in the ESChangePackages as well as those contained by the project in the ESLocalProject
Returns:
true, if the changes should get applied upon the project space, false otherwise
See Also:
ESUpdateCallback.inspectChanges(org.eclipse.emf.emfstore.client.ESLocalProject, java.util.List, org.eclipse.emf.emfstore.common.model.ESModelElementIdToEObjectMapping)

doRun

public ESPrimaryVersionSpec doRun(org.eclipse.core.runtime.IProgressMonitor monitor)
                           throws ESException
The actual behavior that should be performed when the MonitoredEMFStoreAction.execute() is called.
Must be implemented by clients.

Specified by:
doRun in class MonitoredEMFStoreAction<ESPrimaryVersionSpec>
Parameters:
monitor - the IProgressMonitor that should be used by clients to update the status of their progress
Returns:
an optional return value
Throws:
ESException - in case an error occurs
See Also:
MonitoredEMFStoreAction.doRun(org.eclipse.core.runtime.IProgressMonitor)


Copyright © 2015. All Rights Reserved.