本文整理汇总了Java中com.intellij.plugins.haxe.lang.psi.HaxeComponent类的典型用法代码示例。如果您正苦于以下问题:Java HaxeComponent类的具体用法?Java HaxeComponent怎么用?Java HaxeComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HaxeComponent类属于com.intellij.plugins.haxe.lang.psi包,在下文中一共展示了HaxeComponent类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getClassesByName
import com.intellij.plugins.haxe.lang.psi.HaxeComponent; //导入依赖的package包/类
@NotNull
protected List<PsiClass> getClassesByName(final String name,
final boolean checkBoxState,
final String pattern,
final GlobalSearchScope searchScope) {
List<HaxeComponent> components = HaxeComponentIndex.getItemsByName(name, getProject(), searchScope);
List<PsiClass> classes = new ArrayList<PsiClass>();
for (HaxeComponent component : components) {
if (component instanceof PsiClass) {
classes.add((PsiClass)component);
}
}
return classes;
}
示例2: getItemsByName
import com.intellij.plugins.haxe.lang.psi.HaxeComponent; //导入依赖的package包/类
public static List<HaxeComponent> getItemsByName(String name, Project project, GlobalSearchScope searchScope) {
HaxeIndexUtil.warnIfDumbMode(project);
Collection<VirtualFile> files =
FileBasedIndex.getInstance().getContainingFiles(HAXE_COMPONENT_INDEX, name, searchScope);
final List<HaxeComponent> result = new ArrayList<HaxeComponent>();
for (VirtualFile vFile : files) {
PsiFile file = PsiManager.getInstance(project).findFile(vFile);
if (file == null || file.getFileType() != HaxeFileType.HAXE_FILE_TYPE) {
continue;
}
final HaxeComponent component = HaxeResolveUtil.findComponentDeclaration(file, name);
if (component != null) {
result.add(component);
}
}
return result;
}
示例3: getItemsByName
import com.intellij.plugins.haxe.lang.psi.HaxeComponent; //导入依赖的package包/类
public static List<HaxeComponent> getItemsByName(String name, Project project, GlobalSearchScope searchScope) {
Collection<VirtualFile> files =
FileBasedIndex.getInstance().getContainingFiles(HAXE_COMPONENT_INDEX, name, searchScope);
final List<HaxeComponent> result = new ArrayList<HaxeComponent>();
for (VirtualFile vFile : files) {
PsiFile file = PsiManager.getInstance(project).findFile(vFile);
if (file == null || file.getFileType() != HaxeFileType.HAXE_FILE_TYPE) {
continue;
}
final HaxeComponent component = HaxeResolveUtil.findComponentDeclaration(file, name);
if (component != null) {
result.add(component);
}
}
return result;
}
示例4: getHaxeFileIcon
import com.intellij.plugins.haxe.lang.psi.HaxeComponent; //导入依赖的package包/类
@Nullable
private static Icon getHaxeFileIcon(HaxeFile file, @Iconable.IconFlags int flags) {
final String fileName = FileUtil.getNameWithoutExtension(file.getName());
for (HaxeComponent component : HaxeResolveUtil.findComponentDeclarations(file)) {
if (fileName.equals(component.getName())) {
return component.getIcon(flags);
}
}
return null;
}
示例5: getItemsByName
import com.intellij.plugins.haxe.lang.psi.HaxeComponent; //导入依赖的package包/类
@NotNull
@Override
public NavigationItem[] getItemsByName(String name, String pattern, Project project, boolean includeNonProjectItems) {
final GlobalSearchScope scope = includeNonProjectItems ? GlobalSearchScope.allScope(project) : GlobalSearchScope.projectScope(project);
final Collection<HaxeComponent> result = HaxeComponentIndex.getItemsByName(name, project, scope);
return result.toArray(new NavigationItem[result.size()]);
}
示例6: tryCreateAnnotation
import com.intellij.plugins.haxe.lang.psi.HaxeComponent; //导入依赖的package包/类
private void tryCreateAnnotation(HaxeReferenceExpression expression) {
final GlobalSearchScope scope = HaxeResolveUtil.getScopeForElement(expression);
final List<HaxeComponent> components =
HaxeComponentIndex.getItemsByName(expression.getText(), expression.getProject(), scope);
if (!components.isEmpty()) {
myHolder.createErrorAnnotation(expression, HaxeBundle.message("haxe.unresolved.type"))
.registerFix(new HaxeTypeAddImportIntentionAction(expression, components));
}
}
示例7: getHaxeFileIcon
import com.intellij.plugins.haxe.lang.psi.HaxeComponent; //导入依赖的package包/类
@Nullable
private static Icon getHaxeFileIcon(HaxeFile file, @Iconable.IconFlags int flags)
{
final String fileName = FileUtil.getNameWithoutExtension(file.getName());
for(HaxeComponent component : HaxeResolveUtil.findComponentDeclarations(file))
{
if(fileName.equals(component.getName()))
{
return IconDescriptorUpdaters.getIcon(component, flags);
}
}
return null;
}
示例8: processTransferableData
import com.intellij.plugins.haxe.lang.psi.HaxeComponent; //导入依赖的package包/类
@Override
public void processTransferableData(Project project, Editor editor, RangeMarker marker, int caretOffset, Ref<Boolean> indented, List<HaxeTextBlockTransferableData> values) {
PsiDocumentManager.getInstance(project).commitAllDocuments();
final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) {
return;
}
int[] startOffsets = new int[]{marker.getStartOffset()};
int[] endOffsets = new int[]{marker.getEndOffset()};
List<String> haxeClassList = new ArrayList<String>();
String qualifiedName;
for (int j = 0; j < startOffsets.length; j++) {
final int startOffset = startOffsets[j];
for (final PsiElement element : CollectHighlightsUtil.getElementsInRange(file, startOffset, endOffsets[j])) {
if (element instanceof HaxeReferenceExpression) {
HaxeReferenceExpression referenceExpression = (HaxeReferenceExpression)element;
if (referenceExpression.resolve() == null) {
final GlobalSearchScope scope = HaxeResolveUtil.getScopeForElement(referenceExpression);
final List<HaxeComponent> components =
HaxeComponentIndex.getItemsByName(referenceExpression.getText(), project, scope);
if (!components.isEmpty() && components.size() == 1) {
qualifiedName = ((HaxeClass)components.get(0)).getQualifiedName();
if (!haxeClassList.contains(qualifiedName)) {
haxeClassList.add(qualifiedName);
}
}
}
}
}
}
if (haxeClassList.isEmpty()) {
return;
}
HaxeRestoreReferencesDialog dialog = new HaxeRestoreReferencesDialog(project, ArrayUtil.toStringArray(haxeClassList));
dialog.show();
String[] selectedObjects = dialog.getSelectedElements();
for (final String object : selectedObjects) {
new WriteCommandAction(project, file) {
@Override
protected void run(@NotNull Result result) throws Throwable {
HaxeAddImportHelper.addImport(object, file);
}
}.execute();
}
}
示例9: HaxeTypeAddImportIntentionAction
import com.intellij.plugins.haxe.lang.psi.HaxeComponent; //导入依赖的package包/类
public HaxeTypeAddImportIntentionAction(@NotNull PsiElement type, @NotNull List<HaxeComponent> components) {
myType = type;
candidates = components;
}