Allow to set typeIcon via LookupElementBuilder

This commit is contained in:
Alexander Zolotov
2014-06-19 19:49:42 +04:00
parent 7aac121779
commit b4495f923d
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2009 JetBrains s.r.o.
* Copyright 2000-2014 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.
@@ -210,9 +210,14 @@ public final class LookupElementBuilder extends LookupElement {
public LookupElementBuilder setTypeText(@Nullable String typeText, boolean grayed) {
return withTypeText(typeText, grayed);
}
public LookupElementBuilder withTypeText(@Nullable String typeText, boolean grayed) {
return withTypeText(typeText, null, grayed);
}
public LookupElementBuilder withTypeText(@Nullable String typeText, @Nullable Icon typeIcon, boolean grayed) {
final LookupElementPresentation presentation = copyPresentation();
presentation.setTypeText(typeText);
presentation.setTypeText(typeText, typeIcon);
presentation.setTypeGrayed(grayed);
return new LookupElementBuilder(myLookupString, myObject, myInsertHandler, null, presentation,
myAllLookupStrings, myCaseSensitive);