use of com.intellij.designer.model.ErrorInfo in project intellij-community by JetBrains.
the class ComponentTree method getHighlightDisplayLevel.
@Nullable
private static HighlightDisplayLevel getHighlightDisplayLevel(Project project, RadComponent component) {
HighlightDisplayLevel displayLevel = null;
SeverityRegistrar severityRegistrar = SeverityRegistrar.getSeverityRegistrar(project);
for (ErrorInfo errorInfo : RadComponent.getError(component)) {
if (displayLevel == null || severityRegistrar.compare(errorInfo.getLevel().getSeverity(), displayLevel.getSeverity()) > 0) {
displayLevel = errorInfo.getLevel();
}
}
return displayLevel;
}
use of com.intellij.designer.model.ErrorInfo in project intellij-community by JetBrains.
the class QuickFixManager method getErrorInfos.
@NotNull
@Override
protected List<ErrorInfo> getErrorInfos() {
RadPropertyTable component = (RadPropertyTable) myComponent;
int selectedRow = component.getSelectedRow();
if (selectedRow < 0 || selectedRow >= component.getRowCount()) {
return Collections.emptyList();
}
ErrorInfo errorInfo = component.getErrorInfoForRow(selectedRow);
if (errorInfo != null) {
return Arrays.asList(errorInfo);
}
return Collections.emptyList();
}
use of com.intellij.designer.model.ErrorInfo in project intellij-community by JetBrains.
the class AbstractQuickFixManager method showHint.
private void showHint() {
if (!myComponent.isShowing() || !IJSwingUtilities.hasFocus(myComponent)) {
hideHint();
return;
}
// 1. Hide previous hint (if any)
hideHint();
// 2. Found error (if any)
List<ErrorInfo> infos = getErrorInfos();
if (!ErrorInfo.haveFixes(infos)) {
hideHint();
return;
}
boolean error = false;
for (ErrorInfo errorInfo : infos) {
if (errorInfo.getLevel() == HighlightDisplayLevel.ERROR) {
error = true;
break;
}
}
// 3. Determine position where this hint should be shown
Rectangle bounds = getErrorBounds();
if (bounds == null) {
return;
}
// 4. Show light bulb to fix this error
myHint = new LightweightHint(new InspectionHint(error ? AllIcons.Actions.QuickfixBulb : AllIcons.Actions.IntentionBulb));
myLastHintBounds = bounds;
myHint.show(myComponent, bounds.x - AllIcons.Actions.IntentionBulb.getIconWidth() - 4, bounds.y, myComponent, new HintHint(myComponent, bounds.getLocation()));
}
use of com.intellij.designer.model.ErrorInfo in project intellij-community by JetBrains.
the class AbstractQuickFixManager method showPopup.
private void showPopup() {
if (myHint == null || !myHint.isVisible()) {
return;
}
List<ErrorInfo> errorInfos = getErrorInfos();
if (!ErrorInfo.haveFixes(errorInfos)) {
return;
}
ListPopup popup = JBPopupFactory.getInstance().createListPopup(new FirstStep(errorInfos));
popup.showUnderneathOf(myHint.getComponent());
}
Aggregations