Search in sources :

Example 1 with ModuleRootAdapter

use of com.intellij.openapi.roots.ModuleRootAdapter in project go-lang-idea-plugin by go-lang-plugin-org.

the class GoVendoringUI method initPanel.

public void initPanel(@NotNull Module module) {
    if (!module.isDisposed()) {
        MessageBusConnection connection = module.getMessageBus().connect(this);
        //noinspection unchecked
        myVendoringEnabledCombo.setModel(myVendoringEnabledComboModel);
        connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {

            @Override
            public void rootsChanged(ModuleRootEvent event) {
                initComboValues(module);
            }
        });
        initComboValues(module);
    }
}
Also used : MessageBusConnection(com.intellij.util.messages.MessageBusConnection) ModuleRootAdapter(com.intellij.openapi.roots.ModuleRootAdapter) ModuleRootEvent(com.intellij.openapi.roots.ModuleRootEvent)

Example 2 with ModuleRootAdapter

use of com.intellij.openapi.roots.ModuleRootAdapter in project go-lang-idea-plugin by go-lang-plugin-org.

the class GoBuildTagsUI method initPanel.

public void initPanel(@NotNull Module module) {
    if (!module.isDisposed()) {
        MessageBusConnection connection = module.getMessageBus().connect(this);
        connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() {

            @Override
            public void rootsChanged(ModuleRootEvent event) {
                initComboValues(module);
            }
        });
        initComboValues(module);
    }
}
Also used : MessageBusConnection(com.intellij.util.messages.MessageBusConnection) ModuleRootAdapter(com.intellij.openapi.roots.ModuleRootAdapter) ModuleRootEvent(com.intellij.openapi.roots.ModuleRootEvent)

Example 3 with ModuleRootAdapter

use of com.intellij.openapi.roots.ModuleRootAdapter in project android by JetBrains.

the class GradleFacet method initFacet.

@Override
public void initFacet() {
    MessageBusConnection connection = getModule().getMessageBus().connect(this);
    connection.subscribe(PROJECT_ROOTS, new ModuleRootAdapter() {

        @Override
        public void rootsChanged(ModuleRootEvent event) {
            ApplicationManager.getApplication().invokeLater(() -> {
                if (!isDisposed()) {
                    PsiDocumentManager.getInstance(getModule().getProject()).commitAllDocuments();
                    updateConfiguration();
                }
            });
        }
    });
    updateConfiguration();
}
Also used : MessageBusConnection(com.intellij.util.messages.MessageBusConnection) ModuleRootAdapter(com.intellij.openapi.roots.ModuleRootAdapter) ModuleRootEvent(com.intellij.openapi.roots.ModuleRootEvent)

Aggregations

ModuleRootAdapter (com.intellij.openapi.roots.ModuleRootAdapter)3 ModuleRootEvent (com.intellij.openapi.roots.ModuleRootEvent)3 MessageBusConnection (com.intellij.util.messages.MessageBusConnection)3