当前位置: 首页>>代码示例>>Java>>正文


Java StructureViewComponent.StructureViewTreeElementWrapper方法代码示例

本文整理汇总了Java中com.intellij.ide.structureView.newStructureView.StructureViewComponent.StructureViewTreeElementWrapper方法的典型用法代码示例。如果您正苦于以下问题:Java StructureViewComponent.StructureViewTreeElementWrapper方法的具体用法?Java StructureViewComponent.StructureViewTreeElementWrapper怎么用?Java StructureViewComponent.StructureViewTreeElementWrapper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ide.structureView.newStructureView.StructureViewComponent的用法示例。


在下文中一共展示了StructureViewComponent.StructureViewTreeElementWrapper方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: isPsiValid

import com.intellij.ide.structureView.newStructureView.StructureViewComponent; //导入方法依赖的package包/类
private static boolean isPsiValid(@NotNull StructureViewComposite.StructureViewDescriptor baseStructureViewDescriptor) {
  final StructureViewComponent view = (StructureViewComponent)baseStructureViewDescriptor.structureView;
  if (view.isDisposed()) return false;

  final Object root = view.getTreeStructure().getRootElement();
  if (root instanceof StructureViewComponent.StructureViewTreeElementWrapper) {
    final TreeElement value = ((StructureViewComponent.StructureViewTreeElementWrapper)root).getValue();
    if (value instanceof StructureViewTreeElement) {
      final Object psi = ((StructureViewTreeElement)value).getValue();
      if (psi instanceof PsiElement) {
        return ((PsiElement)psi).isValid();
      }
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:TemplateLanguageStructureViewBuilder.java

示例2: isPsiValid

import com.intellij.ide.structureView.newStructureView.StructureViewComponent; //导入方法依赖的package包/类
private static boolean isPsiValid(@Nonnull StructureViewComposite.StructureViewDescriptor baseStructureViewDescriptor) {
  final StructureViewComponent view = (StructureViewComponent)baseStructureViewDescriptor.structureView;
  if (view.isDisposed()) return false;

  final Object root = view.getTreeStructure().getRootElement();
  if (root instanceof StructureViewComponent.StructureViewTreeElementWrapper) {
    final TreeElement value = ((StructureViewComponent.StructureViewTreeElementWrapper)root).getValue();
    if (value instanceof StructureViewTreeElement) {
      final Object psi = ((StructureViewTreeElement)value).getValue();
      if (psi instanceof PsiElement) {
        return ((PsiElement)psi).isValid();
      }
    }
  }
  return true;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:TemplateLanguageStructureViewBuilder.java

示例3: getPsi

import com.intellij.ide.structureView.newStructureView.StructureViewComponent; //导入方法依赖的package包/类
@Nullable
private PsiElement getPsi(FilteringTreeStructure.FilteringNode n) {
  final Object delegate = n.getDelegate();
  if (delegate instanceof StructureViewComponent.StructureViewTreeElementWrapper) {
    final TreeElement value = ((StructureViewComponent.StructureViewTreeElementWrapper)delegate).getValue();
    if (value instanceof StructureViewTreeElement) {
      final Object element = ((StructureViewTreeElement)value).getValue();
      if (element instanceof PsiElement) {
        return (PsiElement)element;
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:FileStructurePopup.java

示例4: getSpeedSearchText

import com.intellij.ide.structureView.newStructureView.StructureViewComponent; //导入方法依赖的package包/类
@Nullable
public static String getSpeedSearchText(final Object userObject) {
  String text = String.valueOf(userObject);
  if (text != null) {
    if (userObject instanceof StructureViewComponent.StructureViewTreeElementWrapper) {
      final TreeElement value = ((StructureViewComponent.StructureViewTreeElementWrapper)userObject).getValue();
      if (value instanceof PsiTreeElementBase && ((PsiTreeElementBase)value).isSearchInLocationString()) {
        final String locationString = ((PsiTreeElementBase)value).getLocationString();
        if (!StringUtil.isEmpty(locationString)) {
          String locationPrefix = null;
          String locationSuffix = null;
          if (value instanceof LocationPresentation) {
            locationPrefix = ((LocationPresentation)value).getLocationPrefix();
            locationSuffix = ((LocationPresentation)value).getLocationSuffix();
          }

          return text +
                 StringUtil.notNullize(locationPrefix, LocationPresentation.DEFAULT_LOCATION_PREFIX) +
                 locationString +
                 StringUtil.notNullize(locationSuffix, LocationPresentation.DEFAULT_LOCATION_SUFFIX);
        }
      }
    }
    return text;
  }

  if (userObject instanceof StructureViewComponent.StructureViewTreeElementWrapper) {
    return ApplicationManager.getApplication().runReadAction(new Computable<String>() {
      @Nullable
      @Override
      public String compute() {
        final ItemPresentation presentation =
          ((StructureViewComponent.StructureViewTreeElementWrapper)userObject).getValue().getPresentation();
        return presentation.getPresentableText();
      }
    });
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:41,代码来源:FileStructurePopup.java

示例5: getSpeedSearchText

import com.intellij.ide.structureView.newStructureView.StructureViewComponent; //导入方法依赖的package包/类
@Nullable
public static String getSpeedSearchText(final Object userObject) {
  String text = String.valueOf(userObject);
  if (text != null) {
    if (userObject instanceof StructureViewComponent.StructureViewTreeElementWrapper) {
      final TreeElement value = ((StructureViewComponent.StructureViewTreeElementWrapper)userObject).getValue();
      if (value instanceof PsiTreeElementBase && ((PsiTreeElementBase)value).isSearchInLocationString()) {
        final String locationString = ((PsiTreeElementBase)value).getLocationString();
        if (!StringUtil.isEmpty(locationString)) {
          String locationPrefix = null;
          String locationSuffix = null;
          if (value instanceof LocationPresentation) {
            locationPrefix = ((LocationPresentation)value).getLocationPrefix();
            locationSuffix = ((LocationPresentation)value).getLocationSuffix();
          }

          return text +
                 StringUtil.notNullize(locationPrefix, LocationPresentation.DEFAULT_LOCATION_PREFIX) +
                 locationString +
                 StringUtil.notNullize(locationSuffix, LocationPresentation.DEFAULT_LOCATION_SUFFIX);
        }
      }
    }
    return text;
  }
  // NB!: this point is achievable if the following method returns null
  // see com.intellij.ide.util.treeView.NodeDescriptor.toString
  if (userObject instanceof StructureViewComponent.StructureViewTreeElementWrapper) {
    return ReadAction.compute(() -> {
      final ItemPresentation presentation =
              ((StructureViewComponent.StructureViewTreeElementWrapper)userObject).getValue().getPresentation();
      return presentation.getPresentableText();
    });
  }

  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:38,代码来源:FileStructurePopup.java


注:本文中的com.intellij.ide.structureView.newStructureView.StructureViewComponent.StructureViewTreeElementWrapper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。