Create HypeLink to a module

Answered

In a toolwindow similar to the Event Log, I need to print a link to a module. Is there any way to point to the module root using an HyperLink?

0
6 comments
Official comment

com.intellij.openapi.roots.ui.configuration.ProjectSettingsService#openModuleSettings

What/where do you want to open the module root?

0
Avatar
Permanently deleted user

What would be the right user experience? I now jump to the iml file, but it doesn't look correct.

Ideally, I think it should jump at the Project Structure tree node where the module name is displayed. 

0
Avatar
Permanently deleted user

That will open the module settings. I was thinking more about opening the module in the Project Tree. Like in the following screenshot, where I selected intellij.jvm.analysis module

0

Sorry, misunderstood

This snippet will select in currently selected Project View tab, pass in fixed ID if you always want "Project" tab

ProjectView projectView = ProjectView.getInstance(myProject);
AbstractProjectViewPane projectViewPane = projectView.getProjectViewPaneById(projectView.getCurrentViewId());
if (projectViewPane != null) {
projectViewPane.selectModule(module, true);
}
0
Avatar
Permanently deleted user

Amazing, thanks a lot!

0

Please sign in to leave a comment.