@Plugin(name="Persistence Service Plugin", id="persistence-service", description="Service that facilitates persisting data between the graphical console sessions.") public class PersistenceService extends ConsolePlugin implements ConsoleService
| Constructor and Description |
|---|
PersistenceService() |
| Modifier and Type | Method and Description |
|---|---|
List<Creator> |
getFactories(String category) |
Creator |
getFactory(String category,
String path)
Returns a factory identified by the provided category and path.
|
ArrayList<Creator> |
getSaved(String category) |
List<Persistable.Descriptor> |
getSavedDescriptors(String category) |
Persistable |
make(Persistable.Descriptor descriptor)
Creates a
Persistable instance based on the provided descriptor. |
Persistable |
make(Persistable.Descriptor descriptor,
String title,
JComponent parent,
String category)
Creates a
Persistable instance by letting the user to select one of
the available factories in the given category, and using the provided
descriptor (if any) as the starting point. |
void |
save(Persistable.Descriptor descriptor) |
void |
saveAs(Persistable.Descriptor descriptor,
JComponent parent) |
void |
startService() |
getConsole, getServices, initialize, propertiesChanged, restore, save, setServicesProvider, shutdown, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitstopServicepublic void startService()
startService in interface ConsoleServicepublic Persistable make(Persistable.Descriptor descriptor)
Persistable instance based on the provided descriptor.
No user interaction. An instance of Persistable is constructed by
the Creator identified in the descriptor, then its restore(...)
method is called.descriptor - JavaBean that describes the Persistable type and state.Persistable, or null if it cannot be created.public Persistable make(Persistable.Descriptor descriptor, String title, JComponent parent, String category)
Persistable instance by letting the user to select one of
the available factories in the given category, and using the provided
descriptor (if any) as the starting point.descriptor - Object state to be used as a starting point.title - User-interaction dialog title, or null if the default title should be used.parent - Graphical component to be use as a parent for user-interaction dialog(s).category - Object category.Persistable, or null if the object creation
was canceled by the user or failed for other reason.public void save(Persistable.Descriptor descriptor)
public void saveAs(Persistable.Descriptor descriptor, JComponent parent)
public Creator getFactory(String category, String path)
category - Creator category.path - Creator path.null if no such factory is known to this service.public List<Persistable.Descriptor> getSavedDescriptors(String category)
Copyright © 2019 LSST. All rights reserved.