Java Code Examples for com.intellij.codeInsight.hint.HintUtil#createErrorLabel()
The following examples show how to use
com.intellij.codeInsight.hint.HintUtil#createErrorLabel() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NavigationGutterIconRenderer.java From consulo with Apache License 2.0 | 5 votes |
@RequiredUIAccess 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)); } } }
Example 2
Source File: FileTextFieldImpl.java From consulo with Apache License 2.0 | 5 votes |
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)); }