forked from redhat-developer/intellij-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 1
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 (redhat-developer#749)
* removed call to ExtensionPointName.create (redhat-developer#749) * made instantiation of PresentationFactory compatible (redhat-developer#749) * removed TriConsumer from commons to make build compatible (redhat-developer#749) * removed deprecated UtilKt.isNull0rEmpty(Collection)(redhat-developer#749) * removed deprecated EdtInvocationManager.isEventDispatchThread(redhat-developer#749) * replaced deprecated StructureTreeModel.invalidate()(redhat-developer#749) Signed-off-by: Andre Dietisheim <[email protected]>
- Loading branch information
Showing
10 changed files
with
47 additions
and
20 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