UML Modeling Layer

com.ibm.xtools.uml.ui.elementselection
Class UMLElementSelectionService

java.lang.Object
  extended by org.eclipse.gmf.runtime.common.core.service.AbstractProvider
      extended by org.eclipse.gmf.runtime.common.core.service.Service
          extended by org.eclipse.gmf.runtime.common.ui.services.elementselection.ElementSelectionService
              extended by com.ibm.xtools.uml.ui.elementselection.UMLElementSelectionService
All Implemented Interfaces:
EventListener, IProvider, IProviderChangeListener, IElementSelectionListener, IElementSelectionProvider

public class UMLElementSelectionService
extends ElementSelectionService

A specialization of GMF's element selection service, that provides support for querying transactional editing domains on multiple background jobs while a thread that has a read or read/write transaction on an editing domain is showing an element selection dialog.

The singleton instance of this class should be used as an alternative to the ElementSelectionService singleton wherever a transactional editing domain is to be queried.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eclipse.gmf.runtime.common.ui.services.elementselection.ElementSelectionService
ElementSelectionService.JobData
 
Field Summary
 
Fields inherited from class org.eclipse.gmf.runtime.common.ui.services.elementselection.ElementSelectionService
jobManager
 
Fields inherited from class org.eclipse.gmf.runtime.common.core.service.Service
INVALID_ELEMENT_MESSAGE_PATTERN
 
Constructor Summary
UMLElementSelectionService()
           
 
Method Summary
protected  ElementSelectionServiceJob createSelectionJob()
          Creates an element selection job that supports a transactional editing domain context.
 List getMatchingObjects(IElementSelectionInput input)
           
 ElementSelectionServiceJob getMatchingObjects(IElementSelectionInput input, IElementSelectionListener listener)
           
static ElementSelectionService getUMLInstance()
          Obtains the singleton instance of the UML Element Selection Service.
 void run(IProgressMonitor monitor)
           
protected  void schedule(IElementSelectionProvider provider, ElementSelectionServiceJob job)
          Schedules the specified element selection job, accounting for the fact that it may not be able to run concurrently with other jobs that require read transactions, if it needs one, itself.
 
Methods inherited from class org.eclipse.gmf.runtime.common.ui.services.elementselection.ElementSelectionService
cancelAllJobs, cancelJob, configureProviders, fireEndOfMatchesEvent, fireMatchingObjectEvent, getInstance, getJobData, getJobName, getJobName, matchingObjectEvent, newProviderDescriptor, resolve
 
Methods inherited from class org.eclipse.gmf.runtime.common.core.service.Service
addProvider, clearCache, configureProviders, configureProviders, createPriorityCache, execute, executeUnique, getAllProviders, getCachingKey, getPriority, getProviders, isOptimistic, isOptimized, providerChanged, provides, provides, removeProvider
 
Methods inherited from class org.eclipse.gmf.runtime.common.core.service.AbstractProvider
addProviderChangeListener, fireProviderChange, removeProviderChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.gmf.runtime.common.core.service.IProvider
addProviderChangeListener, provides, removeProviderChangeListener
 

Constructor Detail

UMLElementSelectionService

public UMLElementSelectionService()
Method Detail

getUMLInstance

public static ElementSelectionService getUMLInstance()
Obtains the singleton instance of the UML Element Selection Service.

Returns:
the singleton instance

getMatchingObjects

public ElementSelectionServiceJob getMatchingObjects(IElementSelectionInput input,
                                                     IElementSelectionListener listener)
Specified by:
getMatchingObjects in interface IElementSelectionProvider
Overrides:
getMatchingObjects in class ElementSelectionService

getMatchingObjects

public List getMatchingObjects(IElementSelectionInput input)
Overrides:
getMatchingObjects in class ElementSelectionService

createSelectionJob

protected ElementSelectionServiceJob createSelectionJob()
Creates an element selection job that supports a transactional editing domain context.

Overrides:
createSelectionJob in class ElementSelectionService

schedule

protected void schedule(IElementSelectionProvider provider,
                        ElementSelectionServiceJob job)
Schedules the specified element selection job, accounting for the fact that it may not be able to run concurrently with other jobs that require read transactions, if it needs one, itself.

Overrides:
schedule in class ElementSelectionService

run

public void run(IProgressMonitor monitor)
Specified by:
run in interface IElementSelectionProvider
Overrides:
run in class ElementSelectionService

UML Modeling Layer

© Copyright IBM Corp. 2009. All rights reserved.