當前位置: 首頁>>代碼示例>>Java>>正文


Java VirtualFileManager.extractProtocol方法代碼示例

本文整理匯總了Java中com.intellij.openapi.vfs.VirtualFileManager.extractProtocol方法的典型用法代碼示例。如果您正苦於以下問題:Java VirtualFileManager.extractProtocol方法的具體用法?Java VirtualFileManager.extractProtocol怎麽用?Java VirtualFileManager.extractProtocol使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.vfs.VirtualFileManager的用法示例。


在下文中一共展示了VirtualFileManager.extractProtocol方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getLocation

import com.intellij.openapi.vfs.VirtualFileManager; //導入方法依賴的package包/類
protected Location getLocation(@NotNull Project project, @NotNull GlobalSearchScope searchScope, String locationUrl) {
  if (locationUrl != null && myLocator != null) {
    String protocolId = VirtualFileManager.extractProtocol(locationUrl);
    if (protocolId != null) {
      String path = VirtualFileManager.extractPath(locationUrl);
      if (!DumbService.isDumb(project) || DumbService.isDumbAware(myLocator)) {
        List<Location> locations = myLocator.getLocation(protocolId, path, project, searchScope);
        if (!locations.isEmpty()) {
          return locations.get(0);
        }
      }
    }
  }

  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:SMTestProxy.java

示例2: getLocation

import com.intellij.openapi.vfs.VirtualFileManager; //導入方法依賴的package包/類
@Nullable
private Location<?> getLocation(String url) {
  String protocol = VirtualFileManager.extractProtocol(url);
  if (protocol == null) {
    return null;
  }
  String path = VirtualFileManager.extractPath(url);
  assertThat(handler.getTestLocator()).isNotNull();
  @SuppressWarnings("rawtypes")
  List<Location> locations =
      handler
          .getTestLocator()
          .getLocation(protocol, path, getProject(), GlobalSearchScope.allScope(getProject()));
  assertThat(locations).hasSize(1);
  return locations.get(0);
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:17,代碼來源:BlazeGoTestEventsHandlerTest.java

示例3: copyLibrary

import com.intellij.openapi.vfs.VirtualFileManager; //導入方法依賴的package包/類
public static void copyLibrary(LibraryEx from, Map<String, String> rootMapping, LibraryEx.ModifiableModelEx target) {
  target.setProperties(from.getProperties());
  for (OrderRootType type : OrderRootType.getAllTypes()) {
    final String[] urls = from.getUrls(type);
    for (String url : urls) {
      final String protocol = VirtualFileManager.extractProtocol(url);
      if (protocol == null) continue;
      final String fullPath = VirtualFileManager.extractPath(url);
      final int sep = fullPath.indexOf(JarFileSystem.JAR_SEPARATOR);
      String localPath;
      String pathInJar;
      if (sep != -1) {
        localPath = fullPath.substring(0, sep);
        pathInJar = fullPath.substring(sep);
      }
      else {
        localPath = fullPath;
        pathInJar = "";
      }
      final String targetPath = rootMapping.get(localPath);
      String targetUrl = targetPath != null ? VirtualFileManager.constructUrl(protocol, targetPath + pathInJar) : url;

      if (from.isJarDirectory(url, type)) {
        target.addJarDirectory(targetUrl, false, type);
      }
      else {
        target.addRoot(targetUrl, type);
      }
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:32,代碼來源:LibraryEditingUtil.java

示例4: correctRepositoryRule

import com.intellij.openapi.vfs.VirtualFileManager; //導入方法依賴的package包/類
private static String correctRepositoryRule(String input) {
  String protocol = VirtualFileManager.extractProtocol(input);
  if (protocol == null) {
    input = VirtualFileManager.constructUrl(URLUtil.HTTP_PROTOCOL, input);
  }
  return input;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:PluginHostsConfigurable.java

示例5: readExternal

import com.intellij.openapi.vfs.VirtualFileManager; //導入方法依賴的package包/類
@Override
public void readExternal(final Element element) throws InvalidDataException {
  final String value = element.getAttributeValue(VALUE_ATTRIBUTE);
  myUrl = value != null ? value : "";
  final String protocol = VirtualFileManager.extractProtocol(myUrl);
  if (protocol == null) myUrl = urlValue(myUrl);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:ExternalizablePath.java

示例6: getUrl

import com.intellij.openapi.vfs.VirtualFileManager; //導入方法依賴的package包/類
public String getUrl() {
  String result = myUrlField.getText();
  if (VirtualFileManager.extractProtocol(result) == null) {
    result = "http://" + result;
  }
  return result;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:EditMavenIndexDialog.java

示例7: getLocation

import com.intellij.openapi.vfs.VirtualFileManager; //導入方法依賴的package包/類
@Nullable
private Location<?> getLocation(String url) {
  String protocol = VirtualFileManager.extractProtocol(url);
  String path = VirtualFileManager.extractPath(url);
  if (protocol == null) {
    return null;
  }
  return Iterables.getFirst(
      handler
          .getTestLocator()
          .getLocation(protocol, path, getProject(), GlobalSearchScope.allScope(getProject())),
      null);
}
 
開發者ID:bazelbuild,項目名稱:intellij,代碼行數:14,代碼來源:BlazeAndroidTestEventsHandlerTest.java


注:本文中的com.intellij.openapi.vfs.VirtualFileManager.extractProtocol方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。