本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}