本文整理汇总了Java中com.intellij.usageView.UsageViewDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java UsageViewDescriptor类的具体用法?Java UsageViewDescriptor怎么用?Java UsageViewDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UsageViewDescriptor类属于com.intellij.usageView包,在下文中一共展示了UsageViewDescriptor类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: customizeUsagesView
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
protected void customizeUsagesView(@NotNull final UsageViewDescriptor viewDescriptor, @NotNull final UsageView usageView) {
final Runnable refactoringRunnable = new Runnable() {
@Override
public void run() {
Set<UsageInfo> usagesToRefactor = UsageViewUtil.getNotExcludedUsageInfos(usageView);
final UsageInfo[] infos = usagesToRefactor.toArray(new UsageInfo[usagesToRefactor.size()]);
if (ensureElementsWritable(infos, viewDescriptor)) {
execute(infos);
}
}
};
String canNotMakeString = RefactoringBundle.message("usageView.need.reRun");
addDoRefactoringAction(usageView, refactoringRunnable, canNotMakeString);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:BaseRefactoringProcessor.java
示例2: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
@Override
protected final UsageViewDescriptor createUsageViewDescriptor(@NotNull UsageInfo[] usages) {
return new UsageViewDescriptorAdapter() {
@NotNull
@Override
public PsiElement[] getElements() {
return new PsiElement[] {myFunction};
}
@Override
public String getProcessedElementsHeader() {
return getRefactoringName();
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:PyBaseMakeFunctionTopLevelProcessor.java
示例3: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
@Override
protected UsageViewDescriptor createUsageViewDescriptor(@NotNull final UsageInfo[] usages) {
return new UsageViewDescriptorAdapter() {
@NotNull
@Override
public PsiElement[] getElements() {
return myElements;
}
@Override
public String getProcessedElementsHeader() {
return REFACTORING_NAME;
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:PyMoveModuleMembersProcessor.java
示例4: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
@Override
protected UsageViewDescriptor createUsageViewDescriptor(@NotNull UsageInfo[] usages) {
return new UsageViewDescriptorAdapter() {
@NotNull
@Override
public PsiElement[] getElements() {
return new PsiElement[]{myStyleTag};
}
@Override
public String getProcessedElementsHeader() {
return "Style to use";
}
@Override
public String getCodeReferencesText(int usagesCount, int filesCount) {
return "Tags the reference to the style will be added to " +
UsageViewBundle.getOccurencesString(usagesCount, filesCount);
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AndroidFindStyleApplicationsProcessor.java
示例5: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
@Override
protected UsageViewDescriptor createUsageViewDescriptor(@NotNull UsageInfo[] usages) {
return new UsageViewDescriptorAdapter() {
@NotNull
@Override
public PsiElement[] getElements() {
return new PsiElement[]{myLayoutFile};
}
@Override
public String getCodeReferencesText(int usagesCount, int filesCount) {
return "References to be inlined" + UsageViewBundle.getReferencesString(usagesCount, filesCount);
}
@Override
public String getProcessedElementsHeader() {
return "Layout file to inline";
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:AndroidInlineLayoutProcessor.java
示例6: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
@Override
protected UsageViewDescriptor createUsageViewDescriptor(@NotNull UsageInfo[] usages) {
return new UsageViewDescriptorAdapter() {
@NotNull
@Override
public PsiElement[] getElements() {
return new PsiElement[]{myStyleElement};
}
@Override
public String getCodeReferencesText(int usagesCount, int filesCount) {
return "References to be inlined" + UsageViewBundle.getReferencesString(usagesCount, filesCount);
}
@Override
public String getProcessedElementsHeader() {
return "Style to inline";
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:AndroidInlineAllStyleUsagesProcessor.java
示例7: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
@Override
protected UsageViewDescriptor createUsageViewDescriptor(@NotNull UsageInfo[] usages) {
return new UsageViewDescriptorAdapter() {
@NotNull
@Override
public PsiElement[] getElements() {
return new PsiElement[]{myHelper.getToSearchFor()};
}
@Override
public String getProcessedElementsHeader() {
return EXTRACT_CLOSURE;
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ExtractClosureProcessorBase.java
示例8: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@Override
@NotNull
protected UsageViewDescriptor createUsageViewDescriptor(@NotNull final UsageInfo[] usages) {
return new UsageViewDescriptorAdapter() {
@NotNull
@Override
public PsiElement[] getElements() {
return new PsiElement[]{toSearchFor != null ? toSearchFor : toReplaceIn};
}
@Override
public String getProcessedElementsHeader() {
return GroovyRefactoringBundle.message("introduce.closure.parameter.elements.header");
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:GrIntroduceClosureParameterProcessor.java
示例9: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
@Override
protected UsageViewDescriptor createUsageViewDescriptor(@NotNull final UsageInfo[] usages) {
return new UsageViewDescriptorAdapter() {
@NotNull
@Override
public PsiElement[] getElements() {
return new PsiElement[]{mySettings.getToSearchFor()};
}
@Override
public String getProcessedElementsHeader() {
return RefactoringBundle.message("introduce.parameter.elements.header");
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:GrIntroduceParameterProcessor.java
示例10: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
@Override
protected UsageViewDescriptor createUsageViewDescriptor(@NotNull UsageInfo[] usages) {
return new UsageViewDescriptorAdapter() {
@NotNull
@Override
public PsiElement[] getElements() {
return myFiles;
}
@Override
public String getProcessedElementsHeader() {
return GroovyRefactoringBundle.message("files.to.be.converted");
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ConvertToJavaProcessor.java
示例11: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
@Override
protected UsageViewDescriptor createUsageViewDescriptor(UsageInfo[] usages) {
return new UsageViewDescriptorAdapter() {
@NotNull
@Override
public PsiElement[] getElements() {
return new PsiElement[]{myHelper.getToSearchFor()};
}
@Override
public String getProcessedElementsHeader() {
return EXTRACT_CLOSURE;
}
};
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:ExtractClosureProcessorBase.java
示例12: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
@Override
protected UsageViewDescriptor createUsageViewDescriptor(final UsageInfo[] usages) {
return new UsageViewDescriptorAdapter() {
@NotNull
@Override
public PsiElement[] getElements() {
return new PsiElement[]{mySettings.getToSearchFor()};
}
@Override
public String getProcessedElementsHeader() {
return RefactoringBundle.message("introduce.parameter.elements.header");
}
};
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:GrIntroduceParameterProcessor.java
示例13: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
@Override
protected UsageViewDescriptor createUsageViewDescriptor(UsageInfo[] usages) {
return new UsageViewDescriptorAdapter() {
@NotNull
@Override
public PsiElement[] getElements() {
return myFiles;
}
@Override
public String getProcessedElementsHeader() {
return GroovyRefactoringBundle.message("files.to.be.converted");
}
};
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:ConvertToJavaProcessor.java
示例14: createRefactoringProcessor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@Override
@RequiredDispatchThread
protected BaseRefactoringProcessor createRefactoringProcessor()
{
CSharpChangeInfo changeInfo = generateChangeInfo();
return new ChangeSignatureProcessorBase(getProject(), changeInfo)
{
@NotNull
@Override
protected UsageViewDescriptor createUsageViewDescriptor(UsageInfo[] usages)
{
return new ChangeSignatureViewDescriptor(myMethod.getMethod());
}
};
}
开发者ID:consulo,项目名称:consulo-csharp,代码行数:17,代码来源:CSharpChangeSignatureDialog.java
示例15: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
protected UsageViewDescriptor createUsageViewDescriptor(@NotNull UsageInfo[] usages) {
if (myConstructor != null) {
return new ReplaceConstructorWithFactoryViewDescriptor(myConstructor);
}
else {
return new ReplaceConstructorWithFactoryViewDescriptor(myOriginalClass);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ReplaceConstructorWithFactoryProcessor.java
示例16: getElementsToWrite
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
protected Collection<? extends PsiElement> getElementsToWrite(@NotNull final UsageViewDescriptor descriptor) {
List<PsiElement> result = new ArrayList<PsiElement>();
result.addAll(super.getElementsToWrite(descriptor));
result.add(myTargetClass);
return result;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:MoveClassToInnerProcessor.java
示例17: getElementsToWrite
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@Override
@NotNull
protected Collection<? extends PsiElement> getElementsToWrite(@NotNull final UsageViewDescriptor descriptor) {
if (myInlineThisOnly) {
return Collections.singletonList(myRefExpr);
}
else {
return super.getElementsToWrite(descriptor);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:InlineConstantFieldProcessor.java
示例18: getElementsToWrite
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
protected Collection<? extends PsiElement> getElementsToWrite(@NotNull final UsageViewDescriptor descriptor) {
if (myInlineThisOnly) {
return Collections.singletonList(myReference);
}
else {
if (!checkReadOnly()) return Collections.emptyList();
return myReference == null ? Collections.singletonList(myMethod) : Arrays.asList(myReference, myMethod);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:InlineMethodProcessor.java
示例19: createUsageViewDescriptor
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
@NotNull
@Override
protected UsageViewDescriptor createUsageViewDescriptor(@NotNull UsageInfo[] usages) {
PsiElement[] elements = new PsiElement[myFilesToMove.size()];
final PsiFile[] classes = PsiUtilCore.toPsiFileArray(myFilesToMove.keySet());
System.arraycopy(classes, 0, elements, 0, classes.length);
return new MoveMultipleElementsViewDescriptor(elements, getTargetName());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:MoveDirectoryWithClassesProcessor.java
示例20: previewRefactoring
import com.intellij.usageView.UsageViewDescriptor; //导入依赖的package包/类
protected void previewRefactoring(@NotNull UsageInfo[] usages) {
if (ApplicationManager.getApplication().isUnitTestMode()) {
execute(usages);
return;
}
final UsageViewDescriptor viewDescriptor = createUsageViewDescriptor(usages);
final PsiElement[] elements = viewDescriptor.getElements();
final PsiElement2UsageTargetAdapter[] targets = PsiElement2UsageTargetAdapter.convert(elements);
Factory<UsageSearcher> factory = new Factory<UsageSearcher>() {
@Override
public UsageSearcher create() {
return new UsageInfoSearcherAdapter() {
@Override
public void generate(@NotNull final Processor<Usage> processor) {
ApplicationManager.getApplication().runReadAction(new Runnable() {
@Override
public void run() {
for (int i = 0; i < elements.length; i++) {
elements[i] = targets[i].getElement();
}
refreshElements(elements);
}
});
processUsages(processor, myProject);
}
@Override
protected UsageInfo[] findUsages() {
return BaseRefactoringProcessor.this.findUsages();
}
};
}
};
showUsageView(viewDescriptor, factory, usages);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:BaseRefactoringProcessor.java
注:本文中的com.intellij.usageView.UsageViewDescriptor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论