public final class DefaultObjectService extends AbstractService implements ObjectService
ObjectCreatedEvent
s, and removes objects
from ObjectDeletedEvent
s.
This is useful to retrieve available objects of a particular type. For
example, the InputHarvester
infrastructure uses it
to provide a pool of available objects for widgets such as the
ObjectWidget
, which provide the user with a
multiple-choice selection.
Constructor and Description |
---|
DefaultObjectService() |
Modifier and Type | Method and Description |
---|---|
EventService |
eventService() |
NamedObjectIndex<Object> |
getIndex()
Gets the index of available objects.
|
void |
initialize()
Performs any needed initialization when the service is first loaded.
|
protected void |
onEvent(ObjectCreatedEvent event) |
protected void |
onEvent(ObjectDeletedEvent event) |
getContext, setContext, toString
getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addObject, addObject, getEventService, getName, getObjects, removeObject
registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
public EventService eventService()
eventService
in interface ObjectService
public NamedObjectIndex<Object> getIndex()
ObjectService
getIndex
in interface ObjectService
public void initialize()
Service
NB: This method is not intended to be called directly. It is called by
the service framework itself (specifically by the ServiceHelper
)
when initializing the service. It should not be called a second time.
initialize
in interface Initializable
initialize
in interface Service
protected void onEvent(ObjectCreatedEvent event)
protected void onEvent(ObjectDeletedEvent event)
Copyright © 2015–2022 SciJava. All rights reserved.