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


Java HaxeFileType类代码示例

本文整理汇总了Java中com.intellij.plugins.haxe.HaxeFileType的典型用法代码示例。如果您正苦于以下问题:Java HaxeFileType类的具体用法?Java HaxeFileType怎么用?Java HaxeFileType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: populateClassesList

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
private static void populateClassesList(List<HaxeClass> classList, Project project, VirtualFile file) {
  VirtualFile[] files = file.getChildren();
  for (VirtualFile virtualFile : files) {
    if (virtualFile.getFileType().equals(HaxeFileType.HAXE_FILE_TYPE)) {
      PsiFile psiFile = PsiManager.getInstance(project).findFile(virtualFile);

      String nameWithoutExtension = virtualFile.getNameWithoutExtension();

      List<HaxeClass> haxeClassList = HaxeResolveUtil.findComponentDeclarations(psiFile);
      for (HaxeClass haxeClass : haxeClassList) {
        if (Objects.equals(haxeClass.getName(), nameWithoutExtension)) {
          classList.add(haxeClass);
        }
      }
    }
  }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:18,代码来源:UsefulPsiTreeUtil.java

示例2: reparseProjectFiles

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
public static void reparseProjectFiles(@NotNull final Project project) {
  Task.Backgroundable task = new Task.Backgroundable(project, HaxeBundle.message("haxe.project.reparsing"), false) {
    public void run(@NotNull ProgressIndicator indicator) {
      final Collection<VirtualFile> haxeFiles = new ArrayList<VirtualFile>();
      final VirtualFile baseDir = project.getBaseDir();
      if (baseDir != null) {
        FileBasedIndex.getInstance().iterateIndexableFiles(new ContentIterator() {
          public boolean processFile(VirtualFile file) {
            if (HaxeFileType.HAXE_FILE_TYPE == file.getFileType()) {
              haxeFiles.add(file);
            }
            return true;
          }
        }, project, indicator);
      }
      ApplicationManager.getApplication().invokeAndWait(new Runnable() {
        public void run() {
          FileContentUtil.reparseFiles(project, haxeFiles, !project.isDefault());
        }
      }, ModalityState.NON_MODAL);
    }
  };
  ProgressManager.getInstance().run(task);
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:25,代码来源:HaxeUtil.java

示例3: detectRoots

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
@NotNull
@Override
public DirectoryProcessingResult detectRoots(@NotNull File dir,
                                             @NotNull File[] children,
                                             @NotNull File base,
                                             @NotNull List<DetectedProjectRoot> result) {
  for (File child : children) {
    if (child.isFile() && child.getName().endsWith(HaxeFileType.DEFAULT_EXTENSION)) {
      Pair<File, String> root =
        CommonSourceRootDetectionUtil.IO_FILE.suggestRootForFileWithPackageStatement(child, base, PACKAGE_NAME_FETCHER, false);
      if (root != null) {
        result.add(new HaxeModuleSourceRoot(root.getFirst()));
        return DirectoryProcessingResult.skipChildrenAndParentsUpTo(root.getFirst());
      }
      else {
        return DirectoryProcessingResult.SKIP_CHILDREN;
      }
    }
  }
  return DirectoryProcessingResult.PROCESS_CHILDREN;
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:22,代码来源:HaxeProjectStructureDetector.java

示例4: getItemsByName

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
public static List<HaxeComponentName> getItemsByName(@NotNull final String name,
                                                     @NotNull final Project project,
                                                     @NotNull final GlobalSearchScope searchScope) {
  HaxeIndexUtil.warnIfDumbMode(project);
  final Collection<VirtualFile> files =
    FileBasedIndex.getInstance().getContainingFiles(HAXE_SYMBOL_INDEX, name, searchScope);
  final Set<HaxeComponentName> result = new THashSet<HaxeComponentName>();
  for (VirtualFile vFile : files) {
    final PsiFile psiFile = PsiManager.getInstance(project).findFile(vFile);
    if (psiFile == null || psiFile.getFileType() != HaxeFileType.HAXE_FILE_TYPE) {
      continue;
    }
    processComponents(psiFile, new PsiElementProcessor<HaxeNamedComponent>() {
      @Override
      public boolean execute(@NotNull HaxeNamedComponent subComponent) {
        if (name.equals(subComponent.getName())) {
          result.add(subComponent.getComponentName());
        }
        return true;
      }
    });
  }
  return new ArrayList<HaxeComponentName>(result);
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:25,代码来源:HaxeSymbolIndex.java

示例5: getItemsByName

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的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;
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:18,代码来源:HaxeComponentIndex.java

示例6: setUpNameComboBox

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
private void setUpNameComboBox(Collection<String> possibleNames) {
  final EditorComboBoxEditor comboEditor = new StringComboboxEditor(myProject, HaxeFileType.HAXE_FILE_TYPE, myNameComboBox);

  myNameComboBox.setEditor(comboEditor);
  myNameComboBox.setRenderer(new EditorComboBoxRenderer(comboEditor));
  myNameComboBox.setEditable(true);
  myNameComboBox.setMaximumRowCount(8);

  myContentPane.registerKeyboardAction(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      myNameComboBox.requestFocus();
    }
  }, KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.ALT_MASK), JComponent.WHEN_IN_FOCUSED_WINDOW);

  for (String possibleName : possibleNames) {
    myNameComboBox.addItem(possibleName);
  }
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:19,代码来源:HaxeIntroduceDialog.java

示例7: getItemsByName

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的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;
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:17,代码来源:HaxeComponentIndex.java

示例8: getApplicableTemplates

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
public static List<FileTemplate> getApplicableTemplates() {
  return getApplicableTemplates(new Condition<FileTemplate>() {
    @Override
    public boolean value(FileTemplate fileTemplate) {
      return HaxeFileType.DEFAULT_EXTENSION.equals(fileTemplate.getExtension());
    }
  });
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:9,代码来源:HaxeFileTemplateUtil.java

示例9: isVisible

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
@Override
public boolean isVisible(@NotNull Usage usage) {
  if (usage instanceof PsiElementUsage) {
    final PsiElement psiElement = ((PsiElementUsage)usage).getElement();
    final PsiFile containingFile = psiElement.getContainingFile();

    if (containingFile != null && containingFile.getFileType() == HaxeFileType.HAXE_FILE_TYPE) {
      return PsiTreeUtil.getParentOfType(psiElement, HaxeImportStatement.class) == null;
    }
  }
  return true;
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:13,代码来源:HaxeImportFilteringRule.java

示例10: containsHaxeFiles

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
private static boolean containsHaxeFiles(final VirtualFile dir) {
  final VirtualFileVisitor.Result result = VfsUtilCore.visitChildrenRecursively(dir, new VirtualFileVisitor() {
    @NotNull
    @Override
    public Result visitFileEx(@NotNull VirtualFile file) {
      return !file.isDirectory() && HaxeFileType.DEFAULT_EXTENSION.equalsIgnoreCase(file.getExtension()) ? skipTo(dir) : CONTINUE;
    }
  });
  return result.skipToParent != null;
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:11,代码来源:HaxeLibRootDetector.java

示例11: setTestStyleSettings

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
private void setTestStyleSettings() {
  Project project = getProject();
  CodeStyleSettings currSettings = CodeStyleSettingsManager.getSettings(project);
  assertNotNull(currSettings);
  CodeStyleSettings tempSettings = currSettings.clone();
  CodeStyleSettings.IndentOptions indentOptions = tempSettings.getIndentOptions(HaxeFileType.HAXE_FILE_TYPE);
  assertNotNull(indentOptions);
  defineStyleSettings(tempSettings);
  CodeStyleSettingsManager.getInstance(project).setTemporarySettings(tempSettings);
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:11,代码来源:HaxeFormatterTest.java

示例12: setTestStyleSettings

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
private void setTestStyleSettings() {
  Project project = getProject();
  CodeStyleSettings currSettings = CodeStyleSettingsManager.getSettings(project);
  assertNotNull(currSettings);
  CodeStyleSettings tempSettings = currSettings.clone();
  CodeStyleSettings.IndentOptions indentOptions = tempSettings.getIndentOptions(HaxeFileType.HAXE_FILE_TYPE);
  indentOptions.INDENT_SIZE = 2;
  assertNotNull(indentOptions);
  CodeStyleSettingsManager.getInstance(project).setTemporarySettings(tempSettings);
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:11,代码来源:HaxeSurroundTest.java

示例13: getClassesForImportStatementWithWildcard

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
@NotNull
public static List<HaxeClass> getClassesForImportStatementWithWildcard(HaxeImportStatementWithWildcard importStatementWithWildcard)
{
	List<HaxeClass> classList = new ArrayList<HaxeClass>();

	String packageStatement = getPackageStatementForImportStatementWithWildcard(importStatementWithWildcard);
	Project project = importStatementWithWildcard.getProject();
	VirtualFile[] virtualDirectoriesForPackage = getVirtualDirectoriesForPackage(packageStatement, project);
	for(VirtualFile file : virtualDirectoriesForPackage)
	{
		VirtualFile[] files = file.getChildren();
		for(VirtualFile virtualFile : files)
		{
			if(virtualFile.getFileType().equals(HaxeFileType.HAXE_FILE_TYPE))
			{
				PsiFile psiFile = PsiManager.getInstance(project).findFile(virtualFile);

				String nameWithoutExtension = virtualFile.getNameWithoutExtension();

				List<HaxeClass> haxeClassList = HaxeResolveUtil.findComponentDeclarations(psiFile);
				for(HaxeClass haxeClass : haxeClassList)
				{
					if(haxeClass.getName().equals(nameWithoutExtension))
					{
						classList.add(haxeClass);
					}
				}
			}
		}
	}
	return classList;
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:33,代码来源:UsefulPsiTreeUtil.java

示例14: createExpressionCodeFragment

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
public static PsiFile createExpressionCodeFragment(Project myProject, String text, PsiElement context, boolean resolveScope)
{
	final String name = "dummy." + HaxeFileType.HAXE_FILE_TYPE.getDefaultExtension();
	HaxeExpressionCodeFragmentImpl codeFragment = new HaxeExpressionCodeFragmentImpl(myProject, name, text, true);
	codeFragment.setContext(context);
	return codeFragment;
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:8,代码来源:HaxeElementGenerator.java

示例15: setTestStyleSettings

import com.intellij.plugins.haxe.HaxeFileType; //导入依赖的package包/类
private void setTestStyleSettings() {
  Project project = getProject();
  CodeStyleSettings currSettings = CodeStyleSettingsManager.getSettings(project);
  Assert.assertNotNull(currSettings);
  CodeStyleSettings tempSettings = currSettings.clone();
  CodeStyleSettings.IndentOptions indentOptions = tempSettings.getIndentOptions(HaxeFileType.HAXE_FILE_TYPE);
  Assert.assertNotNull(indentOptions);
  defineStyleSettings(tempSettings);
  CodeStyleSettingsManager.getInstance(project).setTemporarySettings(tempSettings);
}
 
开发者ID:consulo,项目名称:consulo-haxe,代码行数:11,代码来源:HaxeFormatterTest.java


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