back/forward context for documentation (IDEA-13126)
authoranna <anna.kozlova@jetbrains.com>
Mon, 15 Feb 2010 11:40:08 +0000 (15 14:40 +0300)
committeranna <anna.kozlova@jetbrains.com>
Mon, 15 Feb 2010 14:30:36 +0000 (15 17:30 +0300)
platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java

index 8bcf274..eecfd73 100644 (file)
@@ -250,8 +250,12 @@ public class DocumentationComponent extends JPanel implements Disposable{
     }
 
     public void setText(String text, boolean clean) {
+        if (clean && myElement != null) {
+          myBackStack.push(saveContext());
+          myForwardStack.clear();
+        }
         updateControlState();
-        setDataInternal(myElement, text, new Rectangle(0, 0), true);
+        setDataInternal(myElement, text, new Rectangle(0, 0), !clean);
         if (clean) {
             myIsEmpty = false;
         }