コード例 #1
0
 @Override
 public Object getData(@NonNls String dataId) {
   if (LangDataKeys.PSI_ELEMENT.is(dataId)) {
     final int[] selected = getSelectedRows();
     if (selected.length == 1) {
       return getPsiElementForHint(getValueAt(selected[0], 0));
     }
   }
   return null;
 }
コード例 #2
0
 public Object getData(String dataId) {
   PackageDependenciesNode node = getSelectedNode();
   if (PlatformDataKeys.NAVIGATABLE.is(dataId)) {
     return node;
   }
   if (LangDataKeys.PSI_ELEMENT.is(dataId) && node != null) {
     final PsiElement element = node.getPsiElement();
     return element != null && element.isValid() ? element : null;
   }
   return null;
 }
コード例 #3
0
 @Nullable
 @NonNls
 public Object getData(@NonNls String dataId) {
   if (LangDataKeys.PSI_ELEMENT.is(dataId)) {
     final PackageDependenciesNode selectedNode = myRightTree.getSelectedNode();
     if (selectedNode != null) {
       final PsiElement element = selectedNode.getPsiElement();
       return element != null && element.isValid() ? element : null;
     }
   }
   if (PlatformDataKeys.HELP_ID.is(dataId)) {
     return "dependency.viewer.tool.window";
   }
   return null;
 }