本文整理匯總了Java中com.intellij.openapi.actionSystem.CommonDataKeys.PSI_ELEMENT屬性的典型用法代碼示例。如果您正苦於以下問題:Java CommonDataKeys.PSI_ELEMENT屬性的具體用法?Java CommonDataKeys.PSI_ELEMENT怎麽用?Java CommonDataKeys.PSI_ELEMENT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類com.intellij.openapi.actionSystem.CommonDataKeys
的用法示例。
在下文中一共展示了CommonDataKeys.PSI_ELEMENT屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: calcData
@Override
public void calcData(final DataKey key, final DataSink sink) {
if (!isValid()) return;
if (CommonDataKeys.PSI_ELEMENT == key) {
sink.put(CommonDataKeys.PSI_ELEMENT, myPackage);
}
}
示例2: calcData
@Override
public void calcData(final DataKey key, final DataSink sink) {
if (!isValid()) return;
if (CommonDataKeys.PSI_ELEMENT == key) {
sink.put(CommonDataKeys.PSI_ELEMENT, getPsiClass());
}
if (UsageView.USAGE_INFO_KEY == key) {
PsiClass psiClass = getPsiClass();
if (psiClass != null) {
sink.put(UsageView.USAGE_INFO_KEY, new UsageInfo(psiClass));
}
}
}
示例3: calcData
@Override
public void calcData(final DataKey key, final DataSink sink) {
if (!isValid()) return;
if (CommonDataKeys.PSI_ELEMENT == key) {
sink.put(CommonDataKeys.PSI_ELEMENT, getMethod());
}
if (UsageView.USAGE_INFO_KEY == key) {
PsiMethod method = getMethod();
if (method != null) {
sink.put(UsageView.USAGE_INFO_KEY, new UsageInfo(method));
}
}
}
示例4: calcData
public void calcData(final DataKey key, final DataSink sink) {
if (!isValid()) return;
if (CommonDataKeys.PSI_ELEMENT == key) {
sink.put(CommonDataKeys.PSI_ELEMENT, getElement());
}
if (UsageView.USAGE_INFO_KEY == key) {
T element = getElement();
if (element != null) {
sink.put(UsageView.USAGE_INFO_KEY, new UsageInfo(element));
}
}
}
示例5: calcData
@Override
public void calcData(final DataKey key, final DataSink sink) {
if (!isValid()) return;
if (CommonDataKeys.VIRTUAL_FILE == key) {
sink.put(CommonDataKeys.VIRTUAL_FILE, myDir);
}
if (CommonDataKeys.PSI_ELEMENT == key) {
sink.put(CommonDataKeys.PSI_ELEMENT, getDirectory());
}
}
示例6: calcData
@Override
public void calcData(final DataKey key, final DataSink sink) {
if (key == CommonDataKeys.PSI_ELEMENT) {
final Collection<M> memberInfos = getSelectedMemberInfos();
if (memberInfos.size() > 0) {
sink.put(CommonDataKeys.PSI_ELEMENT, memberInfos.iterator().next().getMember());
}
}
}