本文整理汇总了Java中com.intellij.usages.UsageViewPresentation.setToolwindowTitle方法的典型用法代码示例。如果您正苦于以下问题:Java UsageViewPresentation.setToolwindowTitle方法的具体用法?Java UsageViewPresentation.setToolwindowTitle怎么用?Java UsageViewPresentation.setToolwindowTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.usages.UsageViewPresentation
的用法示例。
在下文中一共展示了UsageViewPresentation.setToolwindowTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: 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;
}