org.eclipse.emf.ecp.view.model.preview.common
Class PreviewReferenceService

java.lang.Object
  extended by org.eclipse.emf.ecp.view.model.preview.common.PreviewReferenceService
All Implemented Interfaces:
ReferenceService, ViewModelService

public class PreviewReferenceService
extends Object
implements ReferenceService

Author:
Alexandra Buzila

Constructor Summary
PreviewReferenceService()
           
 
Method Summary
 void addModelElement(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.ecore.EReference eReference)
          Adds a model element to the EReference.
 void dispose()
          Dispose.
 org.eclipse.emf.ecore.EObject getExistingElementFor(org.eclipse.emf.ecore.EReference eReference)
          Returns an existing EObject that is suitable for the passed EReference.
 org.eclipse.emf.ecore.EObject getNewElementFor(org.eclipse.emf.ecore.EReference eReference)
          Returns a new EObject that is suitable for the passed EReference.
 int getPriority()
          Returns the priority for this view service.
 void instantiate(ViewModelContext context)
          Instantiate the view service.
 void openInNewContext(org.eclipse.emf.ecore.EObject eObject)
          Opens an EObject in a new context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PreviewReferenceService

public PreviewReferenceService()
Method Detail

instantiate

public void instantiate(ViewModelContext context)
Instantiate the view service.

Specified by:
instantiate in interface ViewModelService
Parameters:
context - the ViewModelContext
See Also:
ViewModelService.instantiate(org.eclipse.emf.ecp.view.spi.context.ViewModelContext)

dispose

public void dispose()
Dispose.

Specified by:
dispose in interface ViewModelService
See Also:
ViewModelService.dispose()

getPriority

public int getPriority()
Returns the priority for this view service.

Specified by:
getPriority in interface ViewModelService
Returns:
the priority
See Also:
ViewModelService.getPriority()

addModelElement

public void addModelElement(org.eclipse.emf.ecore.EObject eObject,
                            org.eclipse.emf.ecore.EReference eReference)
Adds a model element to the EReference.

Specified by:
addModelElement in interface ReferenceService
Parameters:
eObject - the EObject to add
eReference - the EReference to add the EObject to
See Also:
ReferenceService.addModelElement(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EReference)

getNewElementFor

public org.eclipse.emf.ecore.EObject getNewElementFor(org.eclipse.emf.ecore.EReference eReference)
Returns a new EObject that is suitable for the passed EReference.

Specified by:
getNewElementFor in interface ReferenceService
Parameters:
eReference - the reference to create the element for
Returns:
the created EObject, this EObject is not contained in the tree
See Also:
ReferenceService.getNewElementFor(org.eclipse.emf.ecore.EReference)

getExistingElementFor

public org.eclipse.emf.ecore.EObject getExistingElementFor(org.eclipse.emf.ecore.EReference eReference)
Returns an existing EObject that is suitable for the passed EReference.

Specified by:
getExistingElementFor in interface ReferenceService
Parameters:
eReference - the EReference to find an existing Element for
Returns:
an existing EObject that can be used in this EReference, the returned EObject must already be in the containment tree
See Also:
ReferenceService.getExistingElementFor(org.eclipse.emf.ecore.EReference)

openInNewContext

public void openInNewContext(org.eclipse.emf.ecore.EObject eObject)
Opens an EObject in a new context.

Specified by:
openInNewContext in interface ReferenceService
Parameters:
eObject - the EObject to open in a new context
See Also:
ReferenceService.openInNewContext(org.eclipse.emf.ecore.EObject)


Copyright © 2014. All Rights Reserved.