diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2013-02-08 15:14:04 -0800 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2013-02-08 15:14:04 -0800 |
commit | 9edc8f6b58f71ec510ba36b838f115718d9a174d (patch) | |
tree | 06f6df92024fa534ff27e1c0b5fc8b2002848093 /RegExpSupport | |
parent | b56ea2a18f232d79481e778085fd64e8ae486fc3 (diff) | |
download | idea-9edc8f6b58f71ec510ba36b838f115718d9a174d.tar.gz |
Snapshot of commit 84dc01e773388c2c72a1fc437f313dd5747e7809
from branch master of git://git.jetbrains.org/idea/community.git
Diffstat (limited to 'RegExpSupport')
-rw-r--r-- | RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java b/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java index 27f07d8f0028..c69aa9c60076 100644 --- a/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java +++ b/RegExpSupport/src/org/intellij/lang/regexp/intention/CheckRegExpForm.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2012 JetBrains s.r.o. + * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,6 +32,7 @@ import com.intellij.psi.PsiDocumentManager; import com.intellij.psi.PsiFile; import com.intellij.ui.BalloonImpl; import com.intellij.ui.EditorTextField; +import com.intellij.ui.JBColor; import com.intellij.util.Alarm; import org.intellij.lang.regexp.RegExpLanguage; @@ -106,12 +107,14 @@ public class CheckRegExpForm { @Override public void documentChanged(DocumentEvent e) { updater.cancelAllRequests(); - updater.addRequest(new Runnable() { - @Override - public void run() { - updateBalloon(); - } - }, 200); + if (!updater.isDisposed()) { + updater.addRequest(new Runnable() { + @Override + public void run() { + updateBalloon(); + } + }, 200); + } } }; myRegExp.addDocumentListener(documentListener); @@ -134,7 +137,7 @@ public class CheckRegExpForm { correct = Pattern.compile(myRegExp.getText()).matcher(mySampleText.getText()).matches(); } catch (Exception ignore) {} - mySampleText.setBackground(correct ? new Color(231, 250, 219) : new Color(255, 177, 160)); + mySampleText.setBackground(correct ? new JBColor(new Color(231, 250, 219), new Color(68, 85, 66)) : new JBColor(new Color(255, 177, 160), new Color(110, 43, 40))); BalloonImpl balloon = (BalloonImpl)myRef.get(); if (balloon != null && balloon.isDisposed()) { balloon.revalidate(); |