org.eclipse.core.runtime.Path.hasTrailingSeparator()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(63)

本文整理了Java中org.eclipse.core.runtime.Path.hasTrailingSeparator()方法的一些代码示例,展示了Path.hasTrailingSeparator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Path.hasTrailingSeparator()方法的具体详情如下:
包路径:org.eclipse.core.runtime.Path
类名称:Path
方法名:hasTrailingSeparator

Path.hasTrailingSeparator介绍

暂无

代码示例

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.common

@Override
public IPath removeTrailingSeparator() {
  if (!hasTrailingSeparator()) {
    return this;
  }
  return new Path(device, segments, flags & (HAS_LEADING | IS_UNC | IS_FOR_WINDOWS));
}

代码示例来源:origin: org.eclipse.equinox/common

public IPath removeTrailingSeparator() {
  if (!hasTrailingSeparator()) {
    return this;
  }
  return new Path(device, segments, separators & (HAS_LEADING | IS_UNC));
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.equinox.common

@Override
public IPath removeTrailingSeparator() {
  if (!hasTrailingSeparator()) {
    return this;
  }
  return new Path(device, segments, flags & (HAS_LEADING | IS_UNC | IS_FOR_WINDOWS));
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.equinox.common

public IPath removeTrailingSeparator() {
  if (!hasTrailingSeparator()) {
    return this;
  }
  return new Path(device, segments, separators & (HAS_LEADING | IS_UNC));
}

代码示例来源:origin: org.eclipse.equinox/common

public String getFileExtension() {
  if (hasTrailingSeparator()) {
    return null;
  }
  String lastSegment = lastSegment();
  if (lastSegment == null) {
    return null;
  }
  int index = lastSegment.lastIndexOf('.');
  if (index == -1) {
    return null;
  }
  return lastSegment.substring(index + 1);
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.equinox.common

public String getFileExtension() {
  if (hasTrailingSeparator()) {
    return null;
  }
  String lastSegment = lastSegment();
  if (lastSegment == null) {
    return null;
  }
  int index = lastSegment.lastIndexOf('.');
  if (index == -1) {
    return null;
  }
  return lastSegment.substring(index + 1);
}

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.common

@Override
public String getFileExtension() {
  if (hasTrailingSeparator()) {
    return null;
  }
  String lastSegment = lastSegment();
  if (lastSegment == null) {
    return null;
  }
  int index = lastSegment.lastIndexOf('.');
  if (index == -1) {
    return null;
  }
  return lastSegment.substring(index + 1);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.equinox.common

@Override
public String getFileExtension() {
  if (hasTrailingSeparator()) {
    return null;
  }
  String lastSegment = lastSegment();
  if (lastSegment == null) {
    return null;
  }
  int index = lastSegment.lastIndexOf('.');
  if (index == -1) {
    return null;
  }
  return lastSegment.substring(index + 1);
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.equinox.common

public IPath addTrailingSeparator() {
  if (hasTrailingSeparator() || isRoot()) {
    return this;
  }
  //XXX workaround, see 1GIGQ9V
  if (isEmpty()) {
    return new Path(device, segments, HAS_LEADING);
  }
  return new Path(device, segments, separators | HAS_TRAILING);
}

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.common

@Override
public IPath addFileExtension(String extension) {
  if (isRoot() || isEmpty() || hasTrailingSeparator())
    return this;
  int len = segments.length;
  String[] newSegments = new String[len];
  System.arraycopy(segments, 0, newSegments, 0, len - 1);
  newSegments[len - 1] = segments[len - 1] + '.' + extension;
  return new Path(device, newSegments, flags);
}

代码示例来源:origin: org.eclipse.equinox/common

public IPath addFileExtension(String extension) {
  if (isRoot() || isEmpty() || hasTrailingSeparator())
    return this;
  int len = segments.length;
  String[] newSegments = new String[len];
  System.arraycopy(segments, 0, newSegments, 0, len - 1);
  newSegments[len - 1] = segments[len - 1] + '.' + extension;
  return new Path(device, newSegments, separators);
}

代码示例来源:origin: org.eclipse.equinox/common

public IPath addTrailingSeparator() {
  if (hasTrailingSeparator() || isRoot()) {
    return this;
  }
  //XXX workaround, see 1GIGQ9V
  if (isEmpty()) {
    return new Path(device, segments, HAS_LEADING);
  }
  return new Path(device, segments, separators | HAS_TRAILING);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.equinox.common

@Override
public IPath addTrailingSeparator() {
  if (hasTrailingSeparator() || isRoot()) {
    return this;
  }
  //XXX workaround, see 1GIGQ9V
  if (isEmpty()) {
    return new Path(device, segments, (flags & IS_FOR_WINDOWS) | HAS_LEADING);
  }
  return new Path(device, segments, flags | HAS_TRAILING);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.equinox.common

@Override
public IPath addFileExtension(String extension) {
  if (isRoot() || isEmpty() || hasTrailingSeparator())
    return this;
  int len = segments.length;
  String[] newSegments = new String[len];
  System.arraycopy(segments, 0, newSegments, 0, len - 1);
  newSegments[len - 1] = segments[len - 1] + '.' + extension;
  return new Path(device, newSegments, flags);
}

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.common

@Override
public IPath addTrailingSeparator() {
  if (hasTrailingSeparator() || isRoot()) {
    return this;
  }
  //XXX workaround, see 1GIGQ9V
  if (isEmpty()) {
    return new Path(device, segments, (flags & IS_FOR_WINDOWS) | HAS_LEADING);
  }
  return new Path(device, segments, flags | HAS_TRAILING);
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.equinox.common

public IPath addFileExtension(String extension) {
  if (isRoot() || isEmpty() || hasTrailingSeparator())
    return this;
  int len = segments.length;
  String[] newSegments = new String[len];
  System.arraycopy(segments, 0, newSegments, 0, len - 1);
  newSegments[len - 1] = segments[len - 1] + '.' + extension;
  return new Path(device, newSegments, separators);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

MElementContainer<MMenuElement> findMenuFromPath(MElementContainer<MMenuElement> menu,
      Path menuPath, int segment) {
    int idx = ContributionsAnalyzer.indexForId(menu, menuPath.segment(segment));
    if (idx == -1) {
      if (segment + 1 < menuPath.segmentCount() || !menuPath.hasTrailingSeparator()) {
        return null;
      }
      return menu;
    }
    MElementContainer<MMenuElement> item = (MElementContainer<MMenuElement>) menu.getChildren()
        .get(idx);
    if (item.getChildren().isEmpty()) {
      if (segment + 1 == menuPath.segmentCount()) {
        return menu;
      }
      return null;
    }
    return findMenuFromPath(item, menuPath, segment + 1);
  }
}

相关文章