How to open Database Menu or Dialog programmatically?

Answered

I Have a Button, how can I click  my button to open Database New Menu or Dialog?

I want invoke this menu by my button or

just open the dialog.

I tried ShowSettingsUtil#showSettingsDialog but didn't find  the Configurable class.

0
4 comments

Hi,

You can invoke it programmatically with com.intellij.database.view.ui.DataSourceManagerDialog.showDialog().

You can also invoke the action DatabaseView.LinkedDataSource.CreateDataSource programmatically (with com.intellij.openapi.actionSystem.ex.ActionUtil.invokeAction()).

Please note these methods are not a part of Open API, and they may be changed without preserving backward compatibility.

0

Thanks! I will remember your reminder.

0

Karol Lewandowski, follow up question. Can you also populate the dialog programmatically? Including database type, host, port and credentials

0

Hi,

Unfortunately, I don't see such an option.

0

Please sign in to leave a comment.