mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[ui] create TextCompletionComboBox with spinner
GitOrigin-RevId: c097ec1298defb0bc300bb220c5049c4b0a843e6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d09796e265
commit
f1a515b268
+1
-1
@@ -14,7 +14,7 @@ import com.intellij.ui.*
|
||||
import java.awt.event.KeyEvent
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
class TextCompletionComboBox<T>(
|
||||
open class TextCompletionComboBox<T>(
|
||||
project: Project?,
|
||||
private val converter: TextCompletionComboBoxConverter<T>
|
||||
) : TextCompletionField<T>(project) {
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.openapi.externalSystem.service.ui.completion
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.ui.AnimatedIcon
|
||||
import com.intellij.ui.SpinningProgressIcon
|
||||
import com.intellij.ui.components.fields.ExtendableTextComponent
|
||||
|
||||
class TextCompletionComboBoxWithSpinner<T>(project: Project?, converter: TextCompletionComboBoxConverter<T>) : TextCompletionComboBox<T>(
|
||||
project, converter) {
|
||||
|
||||
private val spinner = SpinningProgressIcon()
|
||||
private val myExtension: ExtendableTextComponent.Extension
|
||||
|
||||
var spinning: Boolean = false
|
||||
set(value) {
|
||||
if (value) {
|
||||
addExtension(myExtension)
|
||||
}
|
||||
else {
|
||||
removeExtension(myExtension)
|
||||
}
|
||||
}
|
||||
get() = field
|
||||
|
||||
init {
|
||||
this.putClientProperty(AnimatedIcon.ANIMATION_IN_RENDERER_ALLOWED, true)
|
||||
myExtension = ExtendableTextComponent.Extension.create(spinner, spinner, null, { })
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user