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

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.UICreateBranchController
All Implemented Interfaces:
ESCommitCallback

public class UICreateBranchController
extends AbstractEMFStoreUIController<ESPrimaryVersionSpec>
implements ESCommitCallback

UIController for branch creation. Slightly modified copy of the commit controller

Author:
wesendon

Field Summary
 
Fields inherited from interface org.eclipse.emf.emfstore.client.callbacks.ESCommitCallback
NOCALLBACK
 
Constructor Summary
UICreateBranchController(org.eclipse.swt.widgets.Shell shell, ESLocalProject projectSpace)
          Constructor.
UICreateBranchController(org.eclipse.swt.widgets.Shell shell, ESLocalProject localProject, BranchVersionSpec branch)
          Constructor.
 
Method Summary
 boolean baseVersionOutOfDate(ESLocalProject projectSpace, org.eclipse.core.runtime.IProgressMonitor progressMonitor)
           Called when the project that should be updated is out of date.
 ESPrimaryVersionSpec doRun(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
          The actual behavior that should be performed when the MonitoredEMFStoreAction.execute() is called.
Must be implemented by clients.
 boolean inspectChanges(ESLocalProject localProject, ESChangePackage changePackage, ESModelElementIdToEObjectMapping idToEObjectMapping)
           Called right before the actual commit is performed.
 void noLocalChanges(ESLocalProject projectSpace)
          Called when there are no changes on the given project space.
 
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

UICreateBranchController

public UICreateBranchController(org.eclipse.swt.widgets.Shell shell,
                                ESLocalProject projectSpace)
Constructor.

Parameters:
shell - the parent Shell that should be used during the creation of the branch
projectSpace - the project space for which to create a branch for

UICreateBranchController

public UICreateBranchController(org.eclipse.swt.widgets.Shell shell,
                                ESLocalProject localProject,
                                BranchVersionSpec branch)
Constructor.

Parameters:
shell - the parent Shell that should be used during the creation of the branch
localProject - the project space for which to create a branch for
branch - the branch to be committed
Method Detail

noLocalChanges

public void noLocalChanges(ESLocalProject projectSpace)
Called when there are no changes on the given project space.

Specified by:
noLocalChanges in interface ESCommitCallback
Parameters:
projectSpace - the project that has no local pending changes
See Also:
ESCommitCallback.noLocalChanges(ESLocalProject)

baseVersionOutOfDate

public boolean baseVersionOutOfDate(ESLocalProject projectSpace,
                                    org.eclipse.core.runtime.IProgressMonitor progressMonitor)

Called when the project that should be updated is out of date.

A caller may veto against updating the project space by returning false.

Specified by:
baseVersionOutOfDate in interface ESCommitCallback
Parameters:
projectSpace - the project being out of date
progressMonitor - the currently used IProgressMonitor
Returns:
true, if the caller is willing to update the project, false otherwise
See Also:
ESCommitCallback.baseVersionOutOfDate(ESLocalProject, IProgressMonitor)

inspectChanges

public boolean inspectChanges(ESLocalProject localProject,
                              ESChangePackage changePackage,
                              ESModelElementIdToEObjectMapping idToEObjectMapping)

Called right before the actual commit is performed.

Implementors may veto against the commit by returning false.

Specified by:
inspectChanges in interface ESCommitCallback
Parameters:
localProject - the project with the local pending changes
changePackage - the actual changes that are up to be inspected
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 commit should continue, false otherwise
See Also:
ESCommitCallback.inspectChanges(ESLocalProject, ESChangePackage, ESModelElementIdToEObjectMapping)

doRun

public ESPrimaryVersionSpec doRun(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
                           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:
progressMonitor - 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.