IDEA-66333 Quick documentation lookup on mouse hover

Don't close explicitly invoked quick doc control during 'auto quick doc' processing
This commit is contained in:
Denis.Zhdanov
2012-07-10 07:46:54 +04:00
parent fc34721d6a
commit 13945bb17a
2 changed files with 19 additions and 4 deletions
@@ -171,6 +171,15 @@ public class DocumentationManager extends DockablePopupManager<DocumentationComp
}
}
/**
* @return <code>true</code> if quick doc control is configured to not prevent user-IDE interaction (e.g. should be closed if
* the user presses a key);
* <code>false</code> otherwise
*/
public boolean isCloseOnSneeze() {
return myCloseOnSneeze;
}
public boolean hasDockedDocWindow() {
return myToolWindow != null;
}
@@ -169,10 +169,10 @@ public class QuickDocOnMouseOverManager {
// Skip the event if the control is shown because of explicit 'show quick doc' action call.
WeakReference<DocumentationManager> ref = myDocumentationManager;
if (ref == null || ref.get() == null) {
if (ref == null || ref.get() == null || !ref.get().isCloseOnSneeze()) {
return;
}
// Skip the event if the mouse is under the opened quick doc control.
Point hintLocation = hint.getLocationOnScreen();
Dimension hintSize = hint.getSize();
@@ -284,14 +284,20 @@ public class QuickDocOnMouseOverManager {
public void run() {
myAlarm.cancelAllRequests();
// Skip the request if it's outdated (the mouse is moved other another element).
DelayedQuickDocInfo info = myDelayedQuickDocInfo;
if (info == null || !info.targetElement.equals(myActiveElements.get(info.editor))) {
return;
}
// Skip the request if there is a control shown as a result of explicit 'show quick doc' (Ctrl + Q) invocation.
if (info.docManager.getDocInfoHint() != null && !info.docManager.isCloseOnSneeze()) {
return;
}
// We don't want to show a quick doc control if there is an active hint (e.g. the mouse is under an invalid element
// and corresponding error info is shown).
if (!info.docManager.hasDockedDocWindow() && myHintManager.hasShownHintsThatWillHideByOtherHint(false)) {
// We don't want to show a quick doc control if there is an active hint (e.g. the mouse is under an invalid element
// and corresponding error info is shown).
myAlarm.addRequest(this, EditorSettingsExternalizable.getInstance().getQuickDocOnMouseOverElementDelayMillis());
return;
}