show a dotted border around the first autopopup item instead of preview

preview is distracting, doesn't show the full text to be inserted
and there seems to be no way of showing it together with the typed prefix
This commit is contained in:
peter
2013-02-08 16:02:37 +01:00
parent 52932b5fa5
commit 6b96824776
2 changed files with 9 additions and 4 deletions
@@ -85,6 +85,10 @@ public class CompletionPreview implements Disposable {
}
private void updatePreview() {
if (true) {
return;
}
LookupElement item = myLookup.getCurrentItem();
if (item == null) {
return;
@@ -118,10 +118,14 @@ public class LookupCellRenderer implements ListCellRenderer {
boolean hasFocus) {
boolean paintBorder = false;
if (!myLookup.isFocused()) {
paintBorder = isSelected && CompletionPreview.hasPreview(myLookup);
isSelected = false;
}
myPanel.setBorder(paintBorder ? new DottedBorder(SELECTED_BACKGROUND_COLOR) : null);
myIsSelected = isSelected;
final LookupElement item = (LookupElement)value;
final Color foreground = getForegroundColor(isSelected);
@@ -397,13 +401,10 @@ public class LookupCellRenderer implements ListCellRenderer {
@Override
public void paint(Graphics g){
if (!myLookup.isFocused() && myLookup.isCompletion()) {
if (!myLookup.isFocused() && myLookup.isCompletion() && !CompletionPreview.hasPreview(myLookup)) {
((Graphics2D)g).setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.6f));
}
super.paint(g);
//if (myUpdateExtender) {
// myLookup.updateExtender();
//}
}
}
}