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


Java FileHyperlinkInfo类代码示例

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


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

示例1: getErrorNavigatable

import com.intellij.execution.filters.FileHyperlinkInfo; //导入依赖的package包/类
@Nullable
@Override
public Navigatable getErrorNavigatable(@NotNull final Project project, final @NotNull String stacktrace) {
  if (myCustomFilter.isEmpty()) {
    return null;
  }

  // iterate stacktrace lines find first navigatable line using
  // stacktrace filters
  final int stacktraceLength = stacktrace.length();
  final String[] lines = StringUtil.splitByLines(stacktrace);
  for (String line : lines) {
    Filter.Result result;
    try {
      result = myCustomFilter.applyFilter(line, stacktraceLength);
    }
    catch (Throwable t) {
      throw new RuntimeException("Error while applying " + myCustomFilter + " to '" + line + "'", t);
    }
    final HyperlinkInfo info = result != null ? result.getFirstHyperlinkInfo() : null;
    if (info != null) {

      // covers 99% use existing cases
      if (info instanceof FileHyperlinkInfo) {
        return ((FileHyperlinkInfo)info).getDescriptor();
      }

      // otherwise
      return new Navigatable() {
        @Override
        public void navigate(boolean requestFocus) {
          info.navigate(project);
        }

        @Override
        public boolean canNavigate() {
          return true;
        }

        @Override
        public boolean canNavigateToSource() {
          return true;
        }
      };
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:49,代码来源:SMTRunnerConsoleProperties.java

示例2: getErrorNavigatable

import com.intellij.execution.filters.FileHyperlinkInfo; //导入依赖的package包/类
@Override
public Navigatable getErrorNavigatable(@NotNull final Project project, final @NotNull String stacktrace) {
  if (myCustomFilter.isEmpty()) {
    return null;
  }

  // iterate stacktrace lines find first navigatable line using
  // stacktrace filters
  final int stacktraceLength = stacktrace.length();
  final String[] lines = StringUtil.splitByLines(stacktrace);
  for (String line : lines) {
    final Filter.Result result = myCustomFilter.applyFilter(line, stacktraceLength);
    if (result != null) {
      final HyperlinkInfo info = result.hyperlinkInfo;

      // covers 99% use existing cases
      if (info instanceof FileHyperlinkInfo) {
        return ((FileHyperlinkInfo)info).getDescriptor();
      }

      // otherwise
      return new Navigatable() {
        @Override
        public void navigate(boolean requestFocus) {
          result.hyperlinkInfo.navigate(project);
        }

        @Override
        public boolean canNavigate() {
          return true;
        }

        @Override
        public boolean canNavigateToSource() {
          return true;
        }
      };
    }
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:42,代码来源:SMTRunnerConsoleProperties.java

示例3: getErrorNavigatable

import com.intellij.execution.filters.FileHyperlinkInfo; //导入依赖的package包/类
@javax.annotation.Nullable
@Override
public Navigatable getErrorNavigatable(@Nonnull final Project project, final @Nonnull String stacktrace) {
  if (myCustomFilter.isEmpty()) {
    return null;
  }

  // iterate stacktrace lines find first navigatable line using
  // stacktrace filters
  final int stacktraceLength = stacktrace.length();
  final String[] lines = StringUtil.splitByLines(stacktrace);
  for (String line : lines) {
    Filter.Result result;
    try {
      result = myCustomFilter.applyFilter(line, stacktraceLength);
    }
    catch (Throwable t) {
      throw new RuntimeException("Error while applying " + myCustomFilter + " to '" + line + "'", t);
    }
    final HyperlinkInfo info = result != null ? result.getFirstHyperlinkInfo() : null;
    if (info != null) {

      // covers 99% use existing cases
      if (info instanceof FileHyperlinkInfo) {
        return ((FileHyperlinkInfo)info).getDescriptor();
      }

      // otherwise
      return new Navigatable() {
        @Override
        public void navigate(boolean requestFocus) {
          info.navigate(project);
        }

        @Override
        public boolean canNavigate() {
          return true;
        }

        @Override
        public boolean canNavigateToSource() {
          return true;
        }
      };
    }
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:49,代码来源:SMTRunnerConsoleProperties.java


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