mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Allow to set typeIcon via LookupElementBuilder
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user