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


Java FrameworkDetector类代码示例

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


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

示例1: saveDetectors

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
private void saveDetectors() {
  final File file = getDetectorsRegistryFile();
  FileUtil.createIfDoesntExist(file);
  try {
    DataOutputStream output = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
    try {
      output.writeInt(REGISTRY_VERSION);
      output.writeInt(myDetectorsVersion);
      final FrameworkDetector[] detectors = FrameworkDetector.EP_NAME.getExtensions();
      output.writeInt(detectors.length);
      for (FrameworkDetector detector : detectors) {
        output.writeUTF(detector.getDetectorId());
        output.writeInt(myDetectorIds.get(detector.getDetectorId()));
        output.writeInt(detector.getDetectorVersion());
      }
    }
    finally {
      output.close();
    }
  }
  catch (IOException e) {
    LOG.info(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:FrameworkDetectorRegistryImpl.java

示例2: FrameworkDetectionProcessor

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
public FrameworkDetectionProcessor(ProgressIndicator progressIndicator, final FrameworkDetectionContext context) {
  myProgressIndicator = progressIndicator;
  final FrameworkDetector[] detectors = FrameworkDetector.EP_NAME.getExtensions();
  myDetectorsByFileType = new MultiMap<FileType, FrameworkDetectorData>();
  for (FrameworkDetector detector : detectors) {
    myDetectorsByFileType.putValue(detector.getFileType(), new FrameworkDetectorData(detector));
  }
  myContext = context;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:FrameworkDetectionProcessor.java

示例3: getIndexer

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
@NotNull
@Override
public DataIndexer<Integer, Void, FileContent> getIndexer() {
  final MultiMap<FileType, Pair<ElementPattern<FileContent>, Integer>> detectors = new MultiMap<FileType, Pair<ElementPattern<FileContent>, Integer>>();
  for (FrameworkDetector detector : FrameworkDetector.EP_NAME.getExtensions()) {
    detectors.putValue(detector.getFileType(), Pair.create(detector.createSuitableFilePattern(), myRegistry.getDetectorId(detector)));
  }
  return new DataIndexer<Integer, Void, FileContent>() {
    @NotNull
    @Override
    public Map<Integer, Void> map(@NotNull FileContent inputData) {
      final FileType fileType = inputData.getFileType();
      if (!detectors.containsKey(fileType)) {
        return Collections.emptyMap();
      }
      Map<Integer, Void> result = null;
      for (Pair<ElementPattern<FileContent>, Integer> pair : detectors.get(fileType)) {
        if (pair.getFirst().accepts(inputData)) {
          if (LOG.isDebugEnabled()) {
            LOG.debug(inputData.getFile() + " accepted by detector " + pair.getSecond());
          }
          if (result == null) {
            result = new HashMap<Integer, Void>();
          }
          myDispatcher.getMulticaster().fileUpdated(inputData.getFile(), pair.getSecond());
          result.put(pair.getSecond(), null);
        }
      }
      return result != null ? result : Collections.<Integer, Void>emptyMap();
    }
  };
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:FrameworkDetectionIndex.java

示例4: getInputFilter

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
@NotNull
@Override
public FileBasedIndex.InputFilter getInputFilter() {
  final Set<FileType> acceptedTypes = new HashSet<FileType>();
  for (FrameworkDetector detector : FrameworkDetector.EP_NAME.getExtensions()) {
    acceptedTypes.add(detector.getFileType());
  }
  return new DefaultFileTypeSpecificInputFilter(acceptedTypes.toArray(new FileType[acceptedTypes.size()]));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:FrameworkDetectionIndex.java

示例5: getFrameworkTypes

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
@NotNull
@Override
public List<? extends FrameworkType> getFrameworkTypes() {
  final List<FrameworkType> types = new ArrayList<FrameworkType>();
  for (FrameworkDetector detector : FrameworkDetector.EP_NAME.getExtensions()) {
    types.add(detector.getFrameworkType());
  }
  return types;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:FrameworkDetectorRegistryImpl.java

示例6: findFrameworkTypeForFacetDetector

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
@Nullable
public static FrameworkType findFrameworkTypeForFacetDetector(@NotNull FacetType<?, ?> facetType) {
  for (FrameworkDetector detector : FrameworkDetector.EP_NAME.getExtensions()) {
    if (detector instanceof FacetBasedFrameworkDetector<?, ?> &&
        ((FacetBasedFrameworkDetector)detector).getFacetType().equals(facetType)) {
      return detector.getFrameworkType();
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:FrameworkDetectionUtil.java

示例7: runDetector

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
private List<? extends DetectedFrameworkDescription> runDetector(Integer detectorId,
                                                                 FileBasedIndex index,
                                                                 DetectionExcludesConfiguration excludesConfiguration,
                                                                 final boolean processNewFilesOnly) {
  Collection<VirtualFile> acceptedFiles = index.getContainingFiles(FrameworkDetectionIndex.NAME, detectorId, GlobalSearchScope.projectScope(myProject));
  final Collection<VirtualFile> filesToProcess;
  if (processNewFilesOnly) {
    filesToProcess = myDetectedFrameworksData.retainNewFiles(detectorId, acceptedFiles);
  }
  else {
    filesToProcess = new ArrayList<VirtualFile>(acceptedFiles);
  }
  FrameworkDetector detector = FrameworkDetectorRegistry.getInstance().getDetectorById(detectorId);
  if (detector == null) {
    LOG.info("Framework detector not found by id " + detectorId);
    return Collections.emptyList();
  }

  ((DetectionExcludesConfigurationImpl)excludesConfiguration).removeExcluded(filesToProcess, detector.getFrameworkType());
  if (LOG.isDebugEnabled()) {
    LOG.debug("Detector '" + detector.getDetectorId() + "': " + acceptedFiles.size() + " accepted files, " + filesToProcess.size() + " files to process");
  }
  final List<? extends DetectedFrameworkDescription> frameworks;
  if (!filesToProcess.isEmpty()) {
    frameworks = detector.detect(filesToProcess, new FrameworkDetectionContextImpl(myProject));
  }
  else {
    frameworks = Collections.emptyList();
  }
  return frameworks;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:FrameworkDetectionManager.java

示例8: getIndexer

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
@NotNull
@Override
public DataIndexer<Integer, Void, FileContent> getIndexer() {
  final MultiMap<FileType, Pair<ElementPattern<FileContent>, Integer>> detectors = new MultiMap<FileType, Pair<ElementPattern<FileContent>, Integer>>();
  for (FrameworkDetector detector : FrameworkDetector.EP_NAME.getExtensions()) {
    detectors.putValue(detector.getFileType(), Pair.create(detector.createSuitableFilePattern(), myRegistry.getDetectorId(detector)));
  }
  return new DataIndexer<Integer, Void, FileContent>() {
    @NotNull
    @Override
    public Map<Integer, Void> map(FileContent inputData) {
      final FileType fileType = inputData.getFileType();
      if (!detectors.containsKey(fileType)) {
        return Collections.emptyMap();
      }
      Map<Integer, Void> result = null;
      for (Pair<ElementPattern<FileContent>, Integer> pair : detectors.get(fileType)) {
        if (pair.getFirst().accepts(inputData)) {
          if (LOG.isDebugEnabled()) {
            LOG.debug(inputData.getFile() + " accepted by detector " + pair.getSecond());
          }
          if (result == null) {
            result = new HashMap<Integer, Void>();
          }
          myDispatcher.getMulticaster().fileUpdated(inputData.getFile(), pair.getSecond());
          result.put(pair.getSecond(), null);
        }
      }
      return result != null ? result : Collections.<Integer, Void>emptyMap();
    }
  };
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:33,代码来源:FrameworkDetectionIndex.java

示例9: getInputFilter

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
@Override
public FileBasedIndex.InputFilter getInputFilter() {
  final Set<FileType> acceptedTypes = new HashSet<FileType>();
  for (FrameworkDetector detector : FrameworkDetector.EP_NAME.getExtensions()) {
    acceptedTypes.add(detector.getFileType());
  }
  return new DefaultFileTypeSpecificInputFilter(acceptedTypes.toArray(new FileType[acceptedTypes.size()]));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:FrameworkDetectionIndex.java

示例10: getDetector

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
@NotNull
@Override
public FrameworkDetector getDetector()
{
    return detector;
}
 
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:7,代码来源:MuleFrameworkDetector.java

示例11: isEnabled

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
public static boolean isEnabled() {
  return FrameworkDetector.EP_NAME.getExtensions().length > 0;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:FrameworkDetectionStep.java

示例12: FrameworkDetectorData

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
public FrameworkDetectorData(FrameworkDetector detector) {
  myDetector = detector;
  myFilePattern = detector.createSuitableFilePattern();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:FrameworkDetectionProcessor.java

示例13: getDetector

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
@NotNull
@Override
public FrameworkDetector getDetector() {
  return myDetector;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:FacetBasedDetectedFrameworkDescription.java

示例14: getDetectorId

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
@Override
public int getDetectorId(@NotNull FrameworkDetector detector) {
  return myDetectorIds.get(detector.getDetectorId());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:FrameworkDetectorRegistryImpl.java

示例15: getDetectorById

import com.intellij.framework.detection.FrameworkDetector; //导入依赖的package包/类
@Override
public FrameworkDetector getDetectorById(int id) {
  return myDetectorById.get(id);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:FrameworkDetectorRegistryImpl.java


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