本文整理汇总了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));
}
示例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));
}
}
}
示例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();
}
示例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));
}
}
}
示例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));
}
示例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));
}
}
}