Search in sources :

Example 6 with ErrorInfo

use of com.intellij.uiDesigner.ErrorInfo in project intellij-community by JetBrains.

the class QuickFixManager method showIntentionHint.

/**
   * Shows intention hint (light bulb) if it's not visible yet.
   */
final void showIntentionHint() {
    if (!myComponent.isShowing() || !IJSwingUtilities.hasFocus(myComponent)) {
        hideIntentionHint();
        return;
    }
    // 1. Hide previous hint (if any)
    hideIntentionHint();
    // 2. Found error (if any)
    final ErrorInfo[] errorInfos = getErrorInfos();
    if (!haveFixes(errorInfos)) {
        hideIntentionHint();
        return;
    }
    // 3. Determine position where this hint should be shown
    final Rectangle bounds = getErrorBounds();
    if (bounds == null) {
        return;
    }
    // 4. Show light bulb to fix this error
    final LightBulbComponentImpl lightBulbComponent = new LightBulbComponentImpl(this, AllIcons.Actions.IntentionBulb);
    myHint = new LightweightHint(lightBulbComponent);
    myLastHintBounds = bounds;
    myHint.show(myComponent, bounds.x - AllIcons.Actions.IntentionBulb.getIconWidth() - 4, bounds.y, myComponent, new HintHint(myComponent, bounds.getLocation()));
}
Also used : HintHint(com.intellij.ui.HintHint) ErrorInfo(com.intellij.uiDesigner.ErrorInfo) LightweightHint(com.intellij.ui.LightweightHint)

Aggregations

ErrorInfo (com.intellij.uiDesigner.ErrorInfo)6 ArrayList (java.util.ArrayList)2 Nullable (org.jetbrains.annotations.Nullable)2 ListPopup (com.intellij.openapi.ui.popup.ListPopup)1 HintHint (com.intellij.ui.HintHint)1 LightweightHint (com.intellij.ui.LightweightHint)1 QuickFix (com.intellij.uiDesigner.quickFixes.QuickFix)1 NotNull (org.jetbrains.annotations.NotNull)1