本文整理汇总了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());
}
}
}