本文整理汇总了Java中com.intellij.usages.UsageViewPresentation类的典型用法代码示例。如果您正苦于以下问题:Java UsageViewPresentation类的具体用法?Java UsageViewPresentation怎么用?Java UsageViewPresentation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UsageViewPresentation类属于com.intellij.usages包,在下文中一共展示了UsageViewPresentation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: OverridingMethodsDialog
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
public OverridingMethodsDialog(Project project, List<UsageInfo> overridingMethods) {
super(project, true);
myOverridingMethods = overridingMethods;
myChecked = new boolean[myOverridingMethods.size()];
for (int i = 0; i < myChecked.length; i++) {
myChecked[i] = true;
}
myMethodText = new String[myOverridingMethods.size()];
for (int i = 0; i < myMethodText.length; i++) {
myMethodText[i] = PsiFormatUtil.formatMethod(
((SafeDeleteOverridingMethodUsageInfo) myOverridingMethods.get(i)).getOverridingMethod(),
PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_CONTAINING_CLASS
| PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_PARAMETERS | PsiFormatUtilBase.SHOW_TYPE,
PsiFormatUtilBase.SHOW_TYPE
);
}
myUsagePreviewPanel = new UsagePreviewPanel(project, new UsageViewPresentation());
setTitle(RefactoringBundle.message("unused.overriding.methods.title"));
init();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:OverridingMethodsDialog.java
示例2: showObjectUpcastedUsageView
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
private void showObjectUpcastedUsageView(final ObjectUpcastedUsageInfo[] usages) {
UsageViewPresentation presentation = new UsageViewPresentation();
presentation.setTargetsNodeText(RefactoringBundle.message("replacing.inheritance.with.delegation"));
presentation.setCodeUsagesString(RefactoringBundle.message("instances.casted.to.java.lang.object"));
final String upcastedString = RefactoringBundle.message("instances.upcasted.to.object");
presentation.setUsagesString(upcastedString);
presentation.setTabText(upcastedString);
UsageViewManager manager = UsageViewManager.getInstance(myProject);
manager.showUsages(
new UsageTarget[]{new PsiElement2UsageTargetAdapter(myClass)},
UsageInfoToUsageConverter.convert(new PsiElement[]{myClass}, usages),
presentation
);
WindowManager.getInstance().getStatusBar(myProject).setInfo(RefactoringBundle.message("instances.upcasted.to.java.lang.object.found"));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:InheritanceToDelegationProcessor.java
示例3: UsageViewTreeModelBuilder
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
public UsageViewTreeModelBuilder(UsageViewPresentation presentation, UsageTarget[] targets) {
//noinspection HardCodedStringLiteral
super(new DefaultMutableTreeNode("temp root"));
myPresentation = presentation;
myRootNode = new RootGroupNode();
setRoot(myRootNode);
myTargets = targets;
myTargetsNodeText = presentation.getTargetsNodeText();
if (myTargetsNodeText != null) {
myTargetsNode = new TargetsRootNode(myTargetsNodeText);
addTargetNodes();
}
else {
myTargetsNode = null;
}
myDetachedMode = presentation.isDetachedMode();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:UsageViewTreeModelBuilder.java
示例4: setupProcessPresentation
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
@NotNull
public static FindUsagesProcessPresentation setupProcessPresentation(@NotNull final Project project,
final boolean showPanelIfOnlyOneUsage,
@NotNull final UsageViewPresentation presentation) {
FindUsagesProcessPresentation processPresentation = new FindUsagesProcessPresentation(presentation);
processPresentation.setShowNotFoundMessage(true);
processPresentation.setShowPanelIfOnlyOneUsage(showPanelIfOnlyOneUsage);
processPresentation.setProgressIndicatorFactory(
new Factory<ProgressIndicator>() {
@NotNull
@Override
public ProgressIndicator create() {
return new FindProgressIndicator(project, presentation.getScopeText());
}
}
);
return processPresentation;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:FindInProjectUtil.java
示例5: showConflicts
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
/**
* Shows a panel with name redefinition conflicts, if needed.
* @param project
* @param conflicts what {@link #findDefinitions} would return
* @param obscured name or its topmost qualifier that is obscured, used at top of pane.
* @param name full name (maybe qualified) to show as obscured and display as qualifier in "would be" chunks.
* @return true iff conflicts is not empty and the panel is shown.
*/
public static boolean showConflicts(Project project, List<Pair<PsiElement, PsiElement>> conflicts, String obscured, @Nullable String name) {
if (conflicts.size() > 0) {
Usage[] usages = new Usage[conflicts.size()];
int i = 0;
for (Pair<PsiElement, PsiElement> pair : conflicts) {
usages[i] = new NameUsage(pair.getFirst(), pair.getSecond(), name != null? name : obscured, name != null);
i += 1;
}
UsageViewPresentation prsnt = new UsageViewPresentation();
prsnt.setTabText(PyBundle.message("CONFLICT.name.$0.obscured", obscured));
prsnt.setCodeUsagesString(PyBundle.message("CONFLICT.name.$0.obscured.cannot.convert", obscured));
prsnt.setUsagesWord(PyBundle.message("CONFLICT.occurrence.sing"));
prsnt.setUsagesString(PyBundle.message("CONFLICT.occurrence.pl"));
UsageViewManager.getInstance(project).showUsages(UsageTarget.EMPTY_ARRAY, usages, prsnt);
return true;
}
return false;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:DeclarationConflictChecker.java
示例6: showObjectUpcastedUsageView
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
private void showObjectUpcastedUsageView(final ObjectUpcastedUsageInfo[] usages) {
UsageViewPresentation presentation = new UsageViewPresentation();
presentation.setTargetsNodeText(RefactoringBundle.message("replacing.inheritance.with.delegation"));
presentation.setCodeUsagesString(RefactoringBundle.message("instances.casted.to.java.lang.object"));
final String upcastedString = RefactoringBundle.message("instances.upcasted.to.object");
presentation.setUsagesString(upcastedString);
presentation.setTabText(upcastedString);
UsageViewManager manager = UsageViewManager.getInstance(myProject);
manager.showUsages(
new UsageTarget[]{new PsiElement2UsageTargetAdapter(myClass)},
UsageInfoToUsageConverter.convert(new UsageInfoToUsageConverter.TargetElementsDescriptor(myClass), usages),
presentation
);
WindowManager.getInstance().getStatusBar(myProject).setInfo(RefactoringBundle.message("instances.upcasted.to.java.lang.object.found"));
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:InheritanceToDelegationProcessor.java
示例7: setupViewPresentation
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
@NotNull
public static UsageViewPresentation setupViewPresentation(final boolean toOpenInNewTab, @NotNull final FindModel findModelCopy) {
final UsageViewPresentation presentation = new UsageViewPresentation();
final String scope = getTitleForScope(findModelCopy);
final String stringToFind = findModelCopy.getStringToFind();
presentation.setScopeText(scope);
if (stringToFind.isEmpty()) {
presentation.setTabText("Files");
presentation.setToolwindowTitle(BundleBase.format("Files in ''{0}''", scope));
presentation.setUsagesString("files");
}
else {
presentation.setTabText(FindBundle.message("find.usage.view.tab.text", stringToFind));
presentation.setToolwindowTitle(FindBundle.message("find.usage.view.toolwindow.title", stringToFind, scope));
presentation.setUsagesString(FindBundle.message("find.usage.view.usages.text", stringToFind));
}
presentation.setOpenInNewTab(toOpenInNewTab);
presentation.setCodeUsages(false);
return presentation;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:FindInProjectUtil.java
示例8: setupProcessPresentation
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
@NotNull
public static FindUsagesProcessPresentation setupProcessPresentation(final Project project,
final boolean showPanelIfOnlyOneUsage,
@NotNull final UsageViewPresentation presentation) {
FindUsagesProcessPresentation processPresentation = new FindUsagesProcessPresentation();
processPresentation.setShowNotFoundMessage(true);
processPresentation.setShowFindOptionsPrompt(false);
processPresentation.setShowPanelIfOnlyOneUsage(showPanelIfOnlyOneUsage);
processPresentation.setProgressIndicatorFactory(
new Factory<ProgressIndicator>() {
@NotNull
@Override
public ProgressIndicator create() {
return new FindProgressIndicator(project, presentation.getScopeText());
}
}
);
return processPresentation;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:FindInProjectUtil.java
示例9: collectData
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
@NotNull
private static List<UsageNode> collectData(@NotNull List<Usage> usages,
@NotNull Collection<UsageNode> visibleNodes, @NotNull UsageViewImpl usageView,
@NotNull UsageViewPresentation presentation) {
@NotNull List<UsageNode> data = new ArrayList<UsageNode>();
int filtered = filtered(usages, usageView);
if (filtered != 0) {
data.add(createStringNode(UsageViewBundle.message("usages.were.filtered.out", filtered)));
}
data.addAll(visibleNodes);
if (data.isEmpty()) {
String progressText = UsageViewManagerImpl.getProgressTitle(presentation);
data.add(createStringNode(progressText));
}
Collections.sort(data, USAGE_NODE_COMPARATOR);
return data;
}
开发者ID:square,项目名称:dagger-intellij-plugin,代码行数:18,代码来源:ShowUsagesAction.java
示例10: actionPerformed
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final Project project = e.getData(CommonDataKeys.PROJECT);
final UsageViewPresentation presentation = new UsageViewPresentation();
presentation.setTabName("Statics");
presentation.setTabText("Statitcs");
final UsageView view = UsageViewManager.getInstance(project).showUsages(UsageTarget.EMPTY_ARRAY, new Usage[0], presentation);
ProgressManager.getInstance().run(new Task.Backgroundable(project, "Searching icons usages") {
@Override
public void run(@NotNull ProgressIndicator indicator) {
JavaPsiFacade facade = JavaPsiFacade.getInstance(project);
GlobalSearchScope all = GlobalSearchScope.allScope(project);
PsiClass allIcons = facade.findClass("com.intellij.icons.AllIcons", all);
searchFields(allIcons, view, indicator);
for (PsiClass iconsClass : facade.findPackage("icons").getClasses(all)) {
searchFields(iconsClass, view, indicator);
}
}
});
}
开发者ID:consulo,项目名称:consulo-java,代码行数:25,代码来源:StaticIconFieldsAction.java
示例11: OverridingMethodsDialog
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
public OverridingMethodsDialog(Project project, List<UsageInfo> overridingMethods)
{
super(project, true);
myOverridingMethods = overridingMethods;
myChecked = new boolean[myOverridingMethods.size()];
for(int i = 0; i < myChecked.length; i++)
{
myChecked[i] = true;
}
myMethodText = new String[myOverridingMethods.size()];
for(int i = 0; i < myMethodText.length; i++)
{
myMethodText[i] = PsiFormatUtil.formatMethod(((SafeDeleteOverridingMethodUsageInfo) myOverridingMethods.get(i)).getOverridingMethod(),
PsiSubstitutor.EMPTY, PsiFormatUtilBase.SHOW_CONTAINING_CLASS | PsiFormatUtilBase.SHOW_NAME | PsiFormatUtilBase.SHOW_PARAMETERS
| PsiFormatUtilBase.SHOW_TYPE, PsiFormatUtilBase.SHOW_TYPE);
}
myUsagePreviewPanel = new UsagePreviewPanel(project, new UsageViewPresentation());
setTitle(RefactoringBundle.message("unused.overriding.methods.title"));
init();
}
开发者ID:consulo,项目名称:consulo-java,代码行数:22,代码来源:OverridingMethodsDialog.java
示例12: collectData
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
@NotNull
private static List<UsageNode> collectData(@NotNull List<Usage> usages,
@NotNull Collection<UsageNode> visibleNodes,
@NotNull UsageViewImpl usageView,
@NotNull UsageViewPresentation presentation) {
@NotNull List<UsageNode> data = new ArrayList<UsageNode>();
int filtered = filtered(usages, usageView);
if (filtered != 0) {
data.add(createStringNode(UsageViewBundle.message("usages.were.filtered.out", filtered)));
}
data.addAll(visibleNodes);
if (data.isEmpty()) {
String progressText = UsageViewManagerImpl.getProgressTitle(presentation);
data.add(createStringNode(progressText));
}
Collections.sort(data, USAGE_NODE_COMPARATOR);
return data;
}
开发者ID:square,项目名称:otto-intellij-plugin,代码行数:19,代码来源:ShowUsagesAction.java
示例13: configure
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
public void configure(@NotNull UsageViewPresentation presentation) {
final String pattern = myConfiguration.getMatchOptions().getSearchPattern();
final String scopeText = myConfiguration.getMatchOptions().getScope().getDisplayName();
presentation.setScopeText(scopeText);
final String usagesString = SSRBundle.message("occurrences.of", pattern);
presentation.setUsagesString(usagesString);
presentation.setTabText(StringUtil.shortenTextWithEllipsis(usagesString, 60, 0, false));
presentation.setUsagesWord(SSRBundle.message("occurrence"));
presentation.setCodeUsagesString(SSRBundle.message("found.occurrences", scopeText));
presentation.setTargetsNodeText(SSRBundle.message("targets.node.text"));
presentation.setCodeUsages(false);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:UsageViewContext.java
示例14: setupViewPresentation
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
@NotNull
public static UsageViewPresentation setupViewPresentation(final boolean toOpenInNewTab, @NotNull FindModel findModel) {
final UsageViewPresentation presentation = new UsageViewPresentation();
final String scope = getTitleForScope(findModel);
final String stringToFind = findModel.getStringToFind();
presentation.setScopeText(scope);
if (stringToFind.isEmpty()) {
presentation.setTabText("Files");
presentation.setToolwindowTitle(BundleBase.format("Files in {0}", scope));
presentation.setUsagesString("files");
}
else {
FindModel.SearchContext searchContext = findModel.getSearchContext();
String contextText = "";
if (searchContext != FindModel.SearchContext.ANY) {
contextText = FindBundle.message("find.context.presentation.scope.label", FindDialog.getPresentableName(searchContext));
}
presentation.setTabText(FindBundle.message("find.usage.view.tab.text", stringToFind, contextText));
presentation.setToolwindowTitle(FindBundle.message("find.usage.view.toolwindow.title", stringToFind, scope, contextText));
presentation.setUsagesString(FindBundle.message("find.usage.view.usages.text", stringToFind));
presentation.setUsagesWord(FindBundle.message("occurrence"));
presentation.setCodeUsagesString(FindBundle.message("found.occurrences"));
presentation.setContextText(contextText);
}
presentation.setOpenInNewTab(toOpenInNewTab);
presentation.setCodeUsages(false);
presentation.setUsageTypeFilteringAvailable(true);
return presentation;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:FindInProjectUtil.java
示例15: AutomaticRenamingDialog
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
public AutomaticRenamingDialog(Project project, AutomaticRenamer renamer) {
super(project, true);
myProject = project;
myRenamer = renamer;
myUsagePreviewPanel = new UsagePreviewPanel(myProject, new UsageViewPresentation());
myUsageFileLabel = new JLabel();
populateData();
myTableModel = new MyTableModel(renamer.allowChangeSuggestedName());
setTitle(myRenamer.getDialogTitle());
init();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:AutomaticRenamingDialog.java
示例16: rebuildPopup
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
private void rebuildPopup(@NotNull final UsageViewImpl usageView,
@NotNull final List<Usage> usages, @NotNull List<UsageNode> nodes,
@NotNull final JTable table, @NotNull final JBPopup popup,
@NotNull final UsageViewPresentation presentation, @NotNull final RelativePoint popupPosition,
boolean findUsagesInProgress) {
ApplicationManager.getApplication().assertIsDispatchThread();
boolean shouldShowMoreSeparator = usages.contains(MORE_USAGES_SEPARATOR);
if (shouldShowMoreSeparator) {
nodes.add(MORE_USAGES_SEPARATOR_NODE);
}
String title = presentation.getTabText();
String fullTitle = getFullTitle(usages, title, shouldShowMoreSeparator,
nodes.size() - (shouldShowMoreSeparator ? 1 : 0), findUsagesInProgress);
((AbstractPopup) popup).setCaption(fullTitle);
List<UsageNode> data = collectData(usages, nodes, usageView, presentation);
MyModel tableModel = setTableModel(table, usageView, data);
List<UsageNode> existingData = tableModel.getItems();
int row = table.getSelectedRow();
int newSelection = updateModel(tableModel, existingData, data, row == -1 ? 0 : row);
if (newSelection < 0 || newSelection >= tableModel.getRowCount()) {
TableScrollingUtil.ensureSelectionExists(table);
newSelection = table.getSelectedRow();
} else {
table.getSelectionModel().setSelectionInterval(newSelection, newSelection);
}
TableScrollingUtil.ensureIndexIsVisible(table, newSelection, 0);
setSizeAndDimensions(table, popup, popupPosition, data);
}
开发者ID:square,项目名称:dagger-intellij-plugin,代码行数:36,代码来源:ShowUsagesAction.java
示例17: UsageViewTreeModelBuilder
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
public UsageViewTreeModelBuilder(@Nonnull UsageViewPresentation presentation, @Nonnull UsageTarget[] targets) {
super(new RootGroupNode());
myRootNode = (RootGroupNode)root;
myTargetsNodeText = presentation.getTargetsNodeText();
myTargets = targets;
myTargetsNode = myTargetsNodeText == null ? null : new TargetsRootNode(myTargetsNodeText);
UIUtil.invokeLaterIfNeeded(()->{
if (myTargetsNodeText != null) {
addTargetNodes();
}
setRoot(myRootNode);
});
}
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:UsageViewTreeModelBuilder.java
示例18: setupViewPresentation
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
@Nonnull
public static UsageViewPresentation setupViewPresentation(final boolean toOpenInNewTab, @Nonnull FindModel findModel) {
final UsageViewPresentation presentation = new UsageViewPresentation();
final String scope = getTitleForScope(findModel);
final String stringToFind = findModel.getStringToFind();
presentation.setScopeText(scope);
if (stringToFind.isEmpty()) {
presentation.setTabText("Files");
presentation.setToolwindowTitle(BundleBase.format("Files in {0}", scope));
presentation.setUsagesString("files");
}
else {
FindModel.SearchContext searchContext = findModel.getSearchContext();
String contextText = "";
if (searchContext != FindModel.SearchContext.ANY) {
contextText = FindBundle.message("find.context.presentation.scope.label", FindDialog.getPresentableName(searchContext));
}
presentation.setTabText(FindBundle.message("find.usage.view.tab.text", stringToFind, contextText));
presentation.setToolwindowTitle(FindBundle.message("find.usage.view.toolwindow.title", stringToFind, scope, contextText));
presentation.setUsagesString(FindBundle.message("find.usage.view.usages.text", stringToFind));
presentation.setUsagesWord(FindBundle.message("occurrence"));
presentation.setCodeUsagesString(FindBundle.message("found.occurrences"));
presentation.setContextText(contextText);
}
presentation.setOpenInNewTab(toOpenInNewTab);
presentation.setCodeUsages(false);
presentation.setUsageTypeFilteringAvailable(true);
return presentation;
}
开发者ID:consulo,项目名称:consulo,代码行数:32,代码来源:FindInProjectUtil.java
示例19: setupProcessPresentation
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
@Nonnull
public static FindUsagesProcessPresentation setupProcessPresentation(@Nonnull final Project project, final boolean showPanelIfOnlyOneUsage, @Nonnull final UsageViewPresentation presentation) {
FindUsagesProcessPresentation processPresentation = new FindUsagesProcessPresentation(presentation);
processPresentation.setShowNotFoundMessage(true);
processPresentation.setShowPanelIfOnlyOneUsage(showPanelIfOnlyOneUsage);
processPresentation.setProgressIndicatorFactory(() -> new FindProgressIndicator(project, presentation.getScopeText()));
return processPresentation;
}
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:FindInProjectUtil.java
示例20: AutomaticRenamingDialog
import com.intellij.usages.UsageViewPresentation; //导入依赖的package包/类
public AutomaticRenamingDialog(Project project, AutomaticRenamer renamer) {
super(project, true);
myProject = project;
myRenamer = renamer;
myUsagePreviewPanel = new UsagePreviewPanel(myProject, new UsageViewPresentation());
myUsageFileLabel = new JLabel();
populateData();
setTitle(myRenamer.getDialogTitle());
init();
}
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:AutomaticRenamingDialog.java
注:本文中的com.intellij.usages.UsageViewPresentation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论