本文整理汇总了Java中com.intellij.usageView.UsageInfo.getSegment方法的典型用法代码示例。如果您正苦于以下问题:Java UsageInfo.getSegment方法的具体用法?Java UsageInfo.getSegment怎么用?Java UsageInfo.getSegment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.usageView.UsageInfo
的用法示例。
在下文中一共展示了UsageInfo.getSegment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ReplacementPreviewDialog
import com.intellij.usageView.UsageInfo; //导入方法依赖的package包/类
public ReplacementPreviewDialog(final Project project, UsageInfo info, String replacementString) {
super(project,true);
setTitle(SSRBundle.message("structural.replace.preview.dialog.title"));
setOKButtonText(SSRBundle.message("replace.preview.oktext"));
this.project = project;
final PsiElement element = info.getElement();
final VirtualFile virtualFile = PsiUtilCore.getVirtualFile(element);
myFileType = virtualFile != null ? virtualFile.getFileType() : FileTypes.PLAIN_TEXT;
init();
Segment range = info.getSegment();
hilight(virtualFile, range.getStartOffset(), range.getEndOffset());
UIUtil.setContent(replacement, replacementString,0,-1,project);
final StructuralSearchProfile profile = StructuralSearchUtil.getProfileByPsiElement(element);
if (profile != null) {
UIUtil.updateHighlighter(replacement, profile);
}
}
示例2: processRangeMarkers
import com.intellij.usageView.UsageInfo; //导入方法依赖的package包/类
public boolean processRangeMarkers(@NotNull Processor<Segment> processor) {
for (UsageInfo usageInfo : getMergedInfos()) {
Segment segment = usageInfo.getSegment();
if (segment != null && !processor.process(segment)) {
return false;
}
}
return true;
}