當前位置: 首頁>>代碼示例>>Java>>正文


Java CommonDataKeys.PSI_ELEMENT屬性代碼示例

本文整理匯總了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);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:PackageGroupingRule.java

示例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));
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:ClassGroupingRule.java

示例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));
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:MethodGroupingRule.java

示例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));
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:PsiElementUsageGroupBase.java

示例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());
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:DirectoryGroupingRule.java

示例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());
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:AbstractMemberSelectionTable.java


注:本文中的com.intellij.openapi.actionSystem.CommonDataKeys.PSI_ELEMENT屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。