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


Java StringUtilRt.endsWithChar方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例5: ensureEnds

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
private static String ensureEnds(@NotNull String s, final char endsWith) {
  return StringUtilRt.endsWithChar(s, endsWith) ? s : s + endsWith;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:FileUtilRt.java

示例6: ensureEnds

import com.intellij.openapi.util.text.StringUtilRt; //导入方法依赖的package包/类
private static String ensureEnds(@Nonnull String s, final char endsWith) {
  return StringUtilRt.endsWithChar(s, endsWith) ? s : s + endsWith;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:FileUtilRt.java


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