use of com.intellij.util.messages.MessageBusConnection in project intellij-plugins by JetBrains.
the class JavaFxHtmlPanel method subscribeForGrayscaleSetting.
private void subscribeForGrayscaleSetting() {
MessageBusConnection settingsConnection = ApplicationManager.getApplication().getMessageBus().connect(this);
MarkdownApplicationSettings.SettingsChangedListener settingsChangedListener = new MarkdownApplicationSettings.SettingsChangedListener() {
@Override
public void onSettingsChange(@NotNull final MarkdownApplicationSettings settings) {
runInPlatformWhenAvailable(() -> {
if (myWebView != null) {
updateFontSmoothingType(myWebView, settings.getMarkdownPreviewSettings().isUseGrayscaleRendering());
}
});
}
};
settingsConnection.subscribe(MarkdownApplicationSettings.SettingsChangedListener.TOPIC, settingsChangedListener);
}
use of com.intellij.util.messages.MessageBusConnection in project intellij-leiningen-plugin by derkork.
the class LeiningenProjectsManagerWatcher method start.
public synchronized void start() {
final MessageBusConnection myBusConnection = project.getMessageBus().connect(myQueue);
myBusConnection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkFileListener() {
public void before(List<? extends VFileEvent> vFileEvents) {
}
public void after(List<? extends VFileEvent> vFileEvents) {
for (VFileEvent vFileEvent : vFileEvents) {
// }
if (vFileEvent instanceof VFileCreateEvent) {
if (isRelevant(vFileEvent.getPath())) {
manager.importLeiningenProject(vFileEvent.getFileSystem().findFileByPath(vFileEvent.getPath()), project);
}
}
}
}
private boolean isRelevant(String path) {
return path != null && path.endsWith(LeiningenConstants.PROJECT_CLJ);
}
});
myBusConnection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() {
public void beforeRootsChange(ModuleRootEvent moduleRootEvent) {
}
public void rootsChanged(ModuleRootEvent moduleRootEvent) {
}
});
myQueue.activate();
}
use of com.intellij.util.messages.MessageBusConnection 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);
}
}
use of com.intellij.util.messages.MessageBusConnection 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);
}
}
use of com.intellij.util.messages.MessageBusConnection in project intellij-community by JetBrains.
the class CompilerManagerImpl method addCompilationStatusListener.
public void addCompilationStatusListener(@NotNull final CompilationStatusListener listener) {
final MessageBusConnection connection = myProject.getMessageBus().connect();
myListenerAdapters.put(listener, connection);
connection.subscribe(CompilerTopics.COMPILATION_STATUS, listener);
}
Aggregations