• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java StringUtilRt类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: equal

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
public static boolean equal(@Nullable CharSequence s1, @Nullable CharSequence s2, boolean caseSensitive) {
  if (s1 == s2) return true;
  if (s1 == null || s2 == null) return false;

  // Algorithm from String.regionMatches()

  if (s1.length() != s2.length()) return false;
  int to = 0;
  int po = 0;
  int len = s1.length();

  while (len-- > 0) {
    char c1 = s1.charAt(to++);
    char c2 = s2.charAt(po++);
    if (c1 == c2) {
      continue;
    }
    if (!caseSensitive && StringUtilRt.charsEqualIgnoreCase(c1, c2)) continue;
    return false;
  }

  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:Comparing.java


示例2: SslSocketFactory

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
public SslSocketFactory() throws GeneralSecurityException, IOException {
  super();
  SSLContext ctx = SSLContext.getInstance("TLS");
  TrustManager[] tms;
  KeyManager[] kms;
  try {
    String caCertPath = System.getProperty(SSL_CA_CERT_PATH);
    String clientCertPath = System.getProperty(SSL_CLIENT_CERT_PATH);
    String clientKeyPath = System.getProperty(SSL_CLIENT_KEY_PATH);
    boolean trustEverybody = StringUtilRt.parseBoolean(System.getProperty(SSL_TRUST_EVERYBODY), false);

    tms = trustEverybody ? new TrustManager[]{new MyTrustEverybodyManager()} :
          caCertPath == null ? new TrustManager[]{} : new TrustManager[]{new MyTrustManager(caCertPath)};
    kms = clientCertPath != null && clientKeyPath != null
          ? new KeyManager[]{new MyKeyManager(clientCertPath, clientKeyPath)}
          : new KeyManager[]{};
  }
  catch (Exception e) {
    throw new RuntimeException(e);
  }

  ctx.init(kms, tms, null);
  myFactory = ctx.getSocketFactory();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:SslSocketFactory.java


示例3: DefaultHtmlDoctypeInitialConfigurator

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
public DefaultHtmlDoctypeInitialConfigurator(ProjectManager projectManager,
                                             PropertiesComponent propertiesComponent) {
  if (!propertiesComponent.getBoolean("DefaultHtmlDoctype.MigrateToHtml5")) {
    propertiesComponent.setValue("DefaultHtmlDoctype.MigrateToHtml5", true);
    ExternalResourceManagerEx.getInstanceEx()
      .setDefaultHtmlDoctype(Html5SchemaProvider.getHtml5SchemaLocation(), projectManager.getDefaultProject());
  }
  // sometimes VFS fails to pick up updated schema contents and we need to force refresh
  if (StringUtilRt.parseInt(propertiesComponent.getValue("DefaultHtmlDoctype.Refreshed"), 0) < VERSION) {
    propertiesComponent.setValue("DefaultHtmlDoctype.Refreshed", Integer.toString(VERSION));
    final String schemaUrl = VfsUtilCore.pathToUrl(Html5SchemaProvider.getHtml5SchemaLocation());
    final VirtualFile schemaFile = VirtualFileManager.getInstance().findFileByUrl(schemaUrl);
    if (schemaFile != null) {
      schemaFile.getParent().refresh(false, true);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DefaultHtmlDoctypeInitialConfigurator.java


示例4: extractArgNum

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
private static int extractArgNum(String[] options) {


    for (String value : options) {
      Integer parsedValue = parseArgNum(value);
      if (parsedValue != null) {
        return parsedValue;
      }
    }

    if (options.length == 1) {
      return StringUtilRt.parseInt(options[0], 0);
    }

    return 0;
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:MapEntryOrKeyValueHintProcessor.java


示例5: createFileTypes

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
@Override
public void createFileTypes(FileTypeConsumer fileTypeConsumer) {
  fileTypeConsumer.consume(
      BuckFileType.INSTANCE, new FileNameMatcherEx() {
        @Override
        public String getPresentableString() {
          return BuckFileUtil.getBuildFileName();
        }

        @Override
        public boolean acceptsCharSequence(CharSequence fileName) {
          String buildFileName = BuckFileUtil.getBuildFileName();
          return StringUtilRt.endsWithIgnoreCase(fileName, buildFileName) ||
            Comparing.equal(fileName, buildFileName, true);
        }
      });
}
 
开发者ID:wangyanxing,项目名称:Buck-IntelliJ-Plugin,代码行数:18,代码来源:BuckFileTypeFactory.java


示例6: createFileTypes

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
@Override
public void createFileTypes(FileTypeConsumer fileTypeConsumer) {
  fileTypeConsumer.consume(
      BuckFileType.INSTANCE,
      new FileNameMatcherEx() {
        @Override
        public String getPresentableString() {
          return BuckFileUtil.getBuildFileName();
        }

        @Override
        public boolean acceptsCharSequence(CharSequence fileName) {
          String buildFileName = BuckFileUtil.getBuildFileName();
          return StringUtilRt.endsWithIgnoreCase(fileName, buildFileName)
              || Comparing.equal(fileName, buildFileName, true);
        }
      });
}
 
开发者ID:facebook,项目名称:buck,代码行数:19,代码来源:BuckFileTypeFactory.java


示例7: appendToPath

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
public static String appendToPath(@NotNull String basePath, @NotNull String relativePath) {
  final boolean endsWithSlash = StringUtilRt.endsWithChar(basePath, '/') || StringUtilRt.endsWithChar(basePath, '\\');
  final boolean startsWithSlash = StringUtil.startsWithChar(relativePath, '/') || StringUtil.startsWithChar(relativePath, '\\');
  String tail;
  if (endsWithSlash && startsWithSlash) {
    tail = trimForwardSlashes(relativePath);
  }
  else if (!endsWithSlash && !startsWithSlash && basePath.length() > 0 && relativePath.length() > 0) {
    tail = "/" + relativePath;
  }
  else {
    tail = relativePath;
  }
  return basePath + tail;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:JpsArtifactPathUtil.java


示例8: setPort

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
private void setPort(String port) {
  if (isSocket()) {
    myPortField.setText(String.valueOf(StringUtilRt.parseInt(port, 0)));
  }
  else {
    myAddressField.setText(port);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:GenericDebuggerParametersRunnerConfigurable.java


示例9: fillPrimitivesNames

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
private static void fillPrimitivesNames(final PsiPrimitiveType type) {
  PRIMITIVES_NAMES.add(type.getBoxedTypeName());
  PRIMITIVES_NAMES.add(type.getCanonicalText());

  PRIMITIVES_SHORT_NAMES.add(StringUtilRt.getShortName(type.getBoxedTypeName()));
  PRIMITIVES_SHORT_NAMES.add(type.getCanonicalText());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ChainCompletionStringUtil.java


示例10: refFilter

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
public CharSequence refFilter(final String root, @NotNull CharSequence read) {
  CharSequence toMatch = StringUtilRt.toUpperCase(read);
  StringBuilder ready = new StringBuilder();
  int prev = 0;
  Matcher matcher = mySelector.matcher(toMatch);

  while (matcher.find()) {
    CharSequence before = read.subSequence(prev, matcher.start(1) - 1);     // Before reference
    final CharSequence href = read.subSequence(matcher.start(1), matcher.end(1)); // The URL
    prev = matcher.end(1) + 1;
    ready.append(before);
    ready.append("\"");
    ready.append(ApplicationManager.getApplication().runReadAction(
      new Computable<String>() {
        @Override
        public String compute() {
          return convertReference(root, href.toString());
        }
      }
    ));
    ready.append("\"");
  }

  ready.append(read, prev, read.length());

  return ready;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:AbstractExternalFilter.java


示例11: parseArguments

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
@NotNull
private static Pair<Boolean, String> parseArguments(@NotNull String arg) {
  boolean username = StringUtilRt.startsWithIgnoreCase(arg, "username");
  String url;
  String[] split = arg.split(" ");
  if (split.length > 2) {
    url = parseUrl(split[2]);
  }
  else {
    url = ""; // XML RPC doesn't like nulls
  }
  return Pair.create(username, url);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:GitAskPassApp.java


示例12: extractIndex

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
private static boolean extractIndex(String[] options) {
  for (String value : options) {
    Boolean parsedValue = parseIndex(value);
    if (parsedValue != null) {
      return parsedValue;
    }
  }

  if (options.length == 1) {
    return StringUtilRt.parseBoolean(options[0], false);
  }

  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:MapEntryOrKeyValueHintProcessor.java


示例13: parseIndex

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
private static Boolean parseIndex(String value) {
  Couple<String> pair = parseValue(value);
  if (pair == null) return null;

  Boolean parsedValue = StringUtilRt.parseBoolean(pair.getSecond(), false);
  if ("index".equals(pair.getFirst())) {
    return parsedValue;
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:MapEntryOrKeyValueHintProcessor.java


示例14: parseArgNum

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
private static Integer parseArgNum(String value) {
  Couple<String> pair = parseValue(value);
  if (pair == null) return null;

  Integer parsedValue = StringUtilRt.parseInt(pair.getSecond(), 0);
  if ("argNum".equals(pair.getFirst())) {
    return parsedValue;
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:MapEntryOrKeyValueHintProcessor.java


示例15: addLabeled

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
@Nonnull
@RequiredUIAccess
public FormBuilder addLabeled(@Nonnull final String labelText, @Nonnull Component component) {
  String newLabelText = labelText;
  if (!StringUtilRt.endsWithChar(newLabelText, ':')) {
    newLabelText += ": ";
  }

  myLayout.add(Label.create(newLabelText), TableLayout.cell(myLineCount, 0));
  myLayout.add(component, TableLayout.cell(myLineCount, 1).fill());

  myLineCount++;
  return this;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:FormBuilder.java


示例16: left

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
@RequiredUIAccess
public static Component left(@Nonnull String text, @Nonnull Component component) {
  if (!StringUtilRt.endsWithChar(text, ':')) {
    text += ": ";
  }

  HorizontalLayout horizontal = HorizontalLayout.create();
  horizontal.add(Label.create(text));
  horizontal.add(component);
  return horizontal;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:LabeledComponents.java


示例17: leftFilled

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
@RequiredUIAccess
public static Component leftFilled(@Nonnull String text, @Nonnull Component component) {
  if (!StringUtilRt.endsWithChar(text, ':')) {
    text += ": ";
  }

  DockLayout dock = DockLayout.create();
  dock.left(Label.create(text));
  dock.center(component);
  return dock;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:LabeledComponents.java


示例18: canRead

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
private boolean canRead(@Nonnull File file) {
  if (file.isDirectory()) {
    return false;
  }

  // migrate from custom extension to default
  if (myUpdateExtension && StringUtilRt.endsWithIgnoreCase(file.getName(), mySchemeExtension)) {
    return true;
  }
  else {
    return StringUtilRt.endsWithIgnoreCase(file.getName(), DirectoryStorageData.DEFAULT_EXT);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:SchemesManagerImpl.java


示例19: createFileName

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
@Nonnull
private String createFileName(@Nonnull CharSequence fileName) {
  if (StringUtilRt.endsWithIgnoreCase(fileName, mySchemeExtension)) {
    fileName = fileName.subSequence(0, fileName.length() - mySchemeExtension.length());
  }
  else if (StringUtilRt.endsWithIgnoreCase(fileName, DirectoryStorageData.DEFAULT_EXT)) {
    fileName = fileName.subSequence(0, fileName.length() - DirectoryStorageData.DEFAULT_EXT.length());
  }
  return fileName.toString();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:SchemesManagerImpl.java


示例20: refFilter

import com.intellij.openapi.util.text.StringUtilRt; //导入依赖的package包/类
public CharSequence refFilter(final String root, @Nonnull CharSequence read) {
  CharSequence toMatch = StringUtilRt.toUpperCase(read);
  StringBuilder ready = new StringBuilder();
  int prev = 0;
  Matcher matcher = mySelector.matcher(toMatch);

  while (matcher.find()) {
    CharSequence before = read.subSequence(prev, matcher.start(1) - 1);     // Before reference
    final CharSequence href = read.subSequence(matcher.start(1), matcher.end(1)); // The URL
    prev = matcher.end(1) + 1;
    ready.append(before);
    ready.append("\"");
    ready.append(ApplicationManager.getApplication().runReadAction(
            new Computable<String>() {
              @Override
              public String compute() {
                return convertReference(root, href.toString());
              }
            }
    ));
    ready.append("\"");
  }

  ready.append(read, prev, read.length());

  return ready;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:AbstractExternalFilter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DataPacketExtension类代码示例发布时间:2022-05-23
下一篇:
Java Label类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap