Show an action popup when Startup
Answered
I need a downloader component, that knows which version of a dependency is currently installed, then checks if an update is available. Then downloads the updated dependency. The plugin shall then automatically use the update.
There shall be a dialog/popup that asks the user whether to download or not. The prompt should show once on startup. It shall have a setting not to ask again on startup.
How can I show the popup in the startup? Is there any method that does the job?
I am a beginner. Please help.
Please sign in to leave a comment.
(1) https://jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_components.html
To execute code when a project is being opened, provide StartupActivity implementation and register an extension for the
com.intellij.postStartupActivityorcom.intellij.backgroundPostStartupActivityextension point (the latter is supported starting with version 2019.3 of the platform).(2) You can use Notifications https://jetbrains.org/intellij/sdk/docs/user_interface_components/notifications.html#top-level-notifications (preferred) or com.intellij.openapi.ui.Messages (modal) with DialogWrapper.DoNotAskOption option.
Thanks for your answer. I'll look into it. I have another question: When I download a dependency via Gradle, it stores the dependency in Gradle cache and IntelliJ shows it as an External Libraries. Is there any way by which I can specifically download/save a dependency(zip file) to my project directory?
See org.jetbrains.idea.maven.aether.ArtifactRepositoryManager#resolveDependency
The above link doesn't work.
This class exists since 2017 in IJ platform