public abstract class DataManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLIENT_PROPERTY_DATA_PROVIDER |
Constructor and Description |
---|
DataManager() |
Modifier and Type | Method and Description |
---|---|
abstract DataContext |
getDataContext()
Deprecated.
use either
getDataContext(Component) or getDataContextFromFocus() |
abstract DataContext |
getDataContext(java.awt.Component component) |
abstract DataContext |
getDataContext(java.awt.Component component,
int x,
int y) |
<any> |
getDataContextFromFocus()
Deprecated.
|
abstract Promise<DataContext> |
getDataContextFromFocusAsync() |
static DataProvider |
getDataProvider(javax.swing.JComponent component) |
static DataManager |
getInstance() |
static DataManager |
getInstanceIfCreated() |
abstract <T> T |
loadFromDataContext(DataContext dataContext,
Key<T> dataKey) |
static void |
registerDataProvider(javax.swing.JComponent component,
DataProvider provider) |
static void |
removeDataProvider(javax.swing.JComponent component) |
abstract <T> void |
saveInDataContext(DataContext dataContext,
Key<T> dataKey,
T data) |
public static final java.lang.String CLIENT_PROPERTY_DATA_PROVIDER
public static DataManager getInstance()
public static DataManager getInstanceIfCreated()
@Deprecated public abstract DataContext getDataContext()
getDataContext(Component)
or getDataContextFromFocus()
DataContext
constructed by the currently focused component@Deprecated public final <any> getDataContextFromFocus()
getDataContextFromFocusAsync()
public abstract Promise<DataContext> getDataContextFromFocusAsync()
DataContext
constructed by the currently focused component.public abstract DataContext getDataContext(java.awt.Component component)
DataContext
constructed by the specified component
public abstract DataContext getDataContext(java.awt.Component component, int x, int y)
DataContext
constructed be the specified component
and the point specified by x
and y
coordinate inside the
component.java.lang.IllegalArgumentException
- if point (x, y)
is not inside component's boundspublic abstract <T> void saveInDataContext(DataContext dataContext, Key<T> dataKey, T data)
dataContext
- should be instance of UserDataHolder
dataKey
- key to store valuedata
- value to storepublic abstract <T> T loadFromDataContext(DataContext dataContext, Key<T> dataKey)
dataContext
- find by key if instance of UserDataHolder
dataKey
- key to find value bysaveInDataContext(DataContext, Key, Object)
public static void registerDataProvider(javax.swing.JComponent component, DataProvider provider)
public static DataProvider getDataProvider(javax.swing.JComponent component)
public static void removeDataProvider(javax.swing.JComponent component)