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.

0
5 comments

(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.postStartupActivity or com.intellij.backgroundPostStartupActivity extension 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.

1
Avatar
Permanently deleted user

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? 

0

See org.jetbrains.idea.maven.aether.ArtifactRepositoryManager#resolveDependency

0
Avatar
Permanently deleted user

The above link doesn't work.

0

This class exists since 2017 in IJ platform

0

Please sign in to leave a comment.