T
- Data type.public class DataKey<T> extends java.lang.Object implements ValueKey<T>
Mainly used via AnActionEvent.getData(DataKey)
calls and DataProvider.getData(String)
implementations.
Corresponding data for given name
is provided by DataProvider
implementations.
Globally available data can be provided via GetDataRule
extension point.
CommonDataKeys
,
PlatformDataKeys
,
LangDataKeys
ValueKey.BeforeIf<T>, ValueKey.BeforeThen<T,TT>
Modifier and Type | Method and Description |
---|---|
static <T> DataKey<T> |
create(java.lang.String name) |
T |
getData(DataContext dataContext) |
T |
getData(DataProvider dataProvider) |
java.lang.String |
getName() |
boolean |
is(java.lang.String dataId)
For short notation, use
MY_KEY.is(dataId) instead of MY_KEY.getName().equals(dataId) . |
public static <T> DataKey<T> create(java.lang.String name)
public java.lang.String getName()
public final boolean is(java.lang.String dataId)
MY_KEY.is(dataId)
instead of MY_KEY.getName().equals(dataId)
.dataId
- key nametrue
if name of DataKey equals to dataId
, false
otherwisepublic T getData(DataContext dataContext)
public T getData(DataProvider dataProvider)