-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: corrected incompatibilities (#749)
* removed call to ExtensionPointName.create (#749) * made instantiation of PresentationFactory compatible (#749) * removed TriConsumer from commons to make build compatible (#749) * removed deprecated UtilKt.isNull0rEmpty(Collection)(#749) * removed deprecated EdtInvocationManager.isEventDispatchThread(#749) * replaced deprecated StructureTreeModel.invalidate()(#749) Signed-off-by: Andre Dietisheim <[email protected]>
- Loading branch information
Showing
10 changed files
with
46 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...kotlin/com/redhat/devtools/intellij/kubernetes/editor/inlay/PresentationFactoryBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Red Hat, Inc. | ||
* Distributed under license by Red Hat, Inc. All rights reserved. | ||
* This program is made available under the terms of the | ||
* Eclipse Public License v2.0 which accompanies this distribution, | ||
* and is available at http://www.eclipse.org/legal/epl-v20.html | ||
* | ||
* Contributors: | ||
* Red Hat, Inc. - initial API and implementation | ||
******************************************************************************/ | ||
import com.intellij.codeInsight.hints.presentation.PresentationFactory | ||
import com.intellij.openapi.editor.Editor | ||
|
||
/** | ||
* A factory that creates a [PresentationFactory]. This class bridges the difference in API between | ||
* <= IC-2022.3 and above. | ||
*/ | ||
object PresentationFactoryBuilder { | ||
fun build(editor: Editor): PresentationFactory? { | ||
try { | ||
val constructor = PresentationFactory::class.java.constructors.firstOrNull() ?: return null | ||
// IC-2022.3: PresentationFactory(EditorImpl), > IC-2022.3: PresentationFactory(Editor) | ||
return constructor.newInstance(editor) as PresentationFactory? | ||
} catch (e: Exception) { | ||
return null | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters