Why IntelliJ IDEA opens a message when I open Spring configuration file and drop-down to choose a profile? And why it doesn't appear anymore if I choose close link?
When you click "Close" on the profile pop-up, it makes a settings change and disables the panel for all spring contexts. (So you are not just closing it for that file and that viewing. IMHO "Close" is a bit of a misleading name. I think the "Close" link should be renamed to "Disable".) You can turn it back on via: File > Settings > [IDE Settings] > Editor > Appearance > "Show Spring Profiles panel" (it's near the bottom)
EDIT
This quirk in the UI has been annoying me for a while. Answering your question made me take a minute to open a usability -issue-report/feature-request to change it. Please vote for it.
EDIT 2 To answer your follow up question in your comment...
The setting is for the IDE only and does not effect anything when you run or test the code. Conversely, it does not pick up any settings from your code. It basically sets what you, IDEA, and IDEA's inspections "see". It makes it so only beans from the selected profile are "active in the IDE. This way you can switch between profiles when editing your code and configurations and get a valid representation of that profile.
For example, take a look at the screenshot below. (You may have to open it in a separate browser tab to see the detail.) In it I have the 'dev' profile active. By doing that I get the following benefits:

The same holds true in code completion when in Java Classes. Notice below the two code completions only show me beans from the active profile:

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With