當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。