当前位置: 首页>>代码示例>>Java>>正文


Java HintUtil.createErrorLabel方法代码示例

本文整理汇总了Java中com.intellij.codeInsight.hint.HintUtil.createErrorLabel方法的典型用法代码示例。如果您正苦于以下问题:Java HintUtil.createErrorLabel方法的具体用法?Java HintUtil.createErrorLabel怎么用?Java HintUtil.createErrorLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.codeInsight.hint.HintUtil的用法示例。


在下文中一共展示了HintUtil.createErrorLabel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showNoSuggestions

import com.intellij.codeInsight.hint.HintUtil; //导入方法依赖的package包/类
private void showNoSuggestions(boolean isExplicit) {
  hideCurrentPopup();

  if (!isExplicit) return;

  final JComponent message = HintUtil.createErrorLabel(IdeBundle.message("file.chooser.completion.no.suggestions"));
  final ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(message, message);
  builder.setRequestFocus(false).setResizable(false).setAlpha(0.1f).setFocusOwners(new Component[] {myPathTextField});
  myNoSuggestionsPopup = builder.createPopup();
  myNoSuggestionsPopup.showInScreenCoordinates(getField(), getLocationForCaret(myPathTextField));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:FileTextFieldImpl.java

示例2: navigate

import com.intellij.codeInsight.hint.HintUtil; //导入方法依赖的package包/类
@Override
public void navigate(@Nullable final MouseEvent event, @Nullable final PsiElement elt) {
  final List<PsiElement> list;

  DumbService dumbService = elt != null ? DumbService.getInstance(elt.getProject()) : null;
  if (dumbService != null) dumbService.setAlternativeResolveEnabled(true);
  try {
    list = getTargetElements();
  }
  finally {
    if (dumbService != null) dumbService.setAlternativeResolveEnabled(false);
  }
  
  if (list.isEmpty()) {
    if (myEmptyText != null) {
      if (event != null) {
        final JComponent label = HintUtil.createErrorLabel(myEmptyText);
        label.setBorder(IdeBorderFactory.createEmptyBorder(2, 7, 2, 7));
        JBPopupFactory.getInstance().createBalloonBuilder(label)
          .setFadeoutTime(3000)
          .setFillColor(HintUtil.ERROR_COLOR)
          .createBalloon()
          .show(new RelativePoint(event), Balloon.Position.above);
      }
    }
    return;
  }
  if (list.size() == 1) {
    PsiNavigateUtil.navigate(list.iterator().next());
  }
  else {
    if (event != null) {
      final JBPopup popup = NavigationUtil.getPsiElementPopup(PsiUtilCore.toPsiElementArray(list), myCellRenderer.compute(), myPopupTitle);
      popup.show(new RelativePoint(event));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:NavigationGutterIconRenderer.java

示例3: showNoSuggestions

import com.intellij.codeInsight.hint.HintUtil; //导入方法依赖的package包/类
private void showNoSuggestions() {
  hideCurrentPopup();
  final JComponent message = HintUtil.createErrorLabel(IdeBundle.message("file.chooser.completion.no.suggestions"));
  final ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(message, message);
  builder.setRequestFocus(false).setResizable(false).setAlpha(0.1f).
    setFocusOwners(new Component[] {myTextField});
  myCurrentPopup = builder.createPopup();
  showPopup();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SearchSupport.java

示例4: navigate

import com.intellij.codeInsight.hint.HintUtil; //导入方法依赖的package包/类
public void navigate(@Nullable final MouseEvent event, @Nullable final PsiElement elt) {
  final List<PsiElement> list = getTargetElements();
  if (list.isEmpty()) {
    if (myEmptyText != null) {
      if (event != null) {
        final JComponent label = HintUtil.createErrorLabel(myEmptyText);
        label.setBorder(IdeBorderFactory.createEmptyBorder(2, 7, 2, 7));
        JBPopupFactory.getInstance().createBalloonBuilder(label)
          .setPreferredPosition(Balloon.Position.above)
          .setFadeoutTime(3000)
          .setFillColor(HintUtil.ERROR_COLOR)
          .createBalloon()
          .show(new RelativePoint(event), Balloon.Position.above);
      }
    }
    return;
  }
  if (list.size() == 1) {
    PsiNavigateUtil.navigate(list.iterator().next());
  }
  else {
    if (event != null) {
      final JBPopup popup = NavigationUtil.getPsiElementPopup(PsiUtilCore.toPsiElementArray(list), myCellRenderer.compute(), myPopupTitle);
      popup.show(new RelativePoint(event));
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:NavigationGutterIconRenderer.java

示例5: showNoSuggestions

import com.intellij.codeInsight.hint.HintUtil; //导入方法依赖的package包/类
private void showNoSuggestions(boolean isExplicit) {
  hideCurrentPopup();

  if (!isExplicit) return;

  final JComponent message = HintUtil.createErrorLabel(IdeBundle.message("file.chooser.completion.no.suggestions"));
  final ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(message, message);
  builder.setRequestFocus(false).setResizable(false).setAlpha(0.1f).setFocusOwners(new Component[]{myPathTextField});
  myNoSuggestionsPopup = builder.createPopup();
  myNoSuggestionsPopup.showInScreenCoordinates(getField(), getLocationForCaret(myPathTextField));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:FileTextFieldImpl.java

示例6: navigate

import com.intellij.codeInsight.hint.HintUtil; //导入方法依赖的package包/类
@RequiredDispatchThread
public void navigate(@Nullable final MouseEvent event, @Nullable final PsiElement elt) {
  final List<PsiElement> list = getTargetElements();
  if (list.isEmpty()) {
    if (myEmptyText != null) {
      if (event != null) {
        final JComponent label = HintUtil.createErrorLabel(myEmptyText);
        label.setBorder(IdeBorderFactory.createEmptyBorder(2, 7, 2, 7));
        JBPopupFactory.getInstance().createBalloonBuilder(label)
          .setFadeoutTime(3000)
          .setFillColor(HintUtil.ERROR_COLOR)
          .createBalloon()
          .show(new RelativePoint(event), Balloon.Position.above);
      }
    }
    return;
  }
  if (list.size() == 1) {
    PsiNavigateUtil.navigate(list.iterator().next());
  }
  else {
    if (event != null) {
      final JBPopup popup = NavigationUtil.getPsiElementPopup(PsiUtilCore.toPsiElementArray(list), myCellRenderer.compute(), myPopupTitle);
      popup.show(new RelativePoint(event));
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:NavigationGutterIconRenderer.java


注:本文中的com.intellij.codeInsight.hint.HintUtil.createErrorLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。