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