Java Code Examples for com.intellij.openapi.application.Application#getMessageBus()

The following examples show how to use com.intellij.openapi.application.Application#getMessageBus() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NoAccessDuringPsiEvents.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static boolean isInsideEventProcessing() {
  Application application = ApplicationManager.getApplication();
  if (!application.isWriteAccessAllowed()) return false;

  MessageBus bus = application.getMessageBus();
  return bus.hasUndeliveredEvents(VirtualFileManager.VFS_CHANGES) || bus.hasUndeliveredEvents(PsiModificationTracker.TOPIC);
}
 
Example 2
Source File: FileDocumentManagerImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Inject
public FileDocumentManagerImpl(Application application, ProjectManager projectManager) {
  ((ProjectManagerEx)projectManager).registerCloseProjectVeto(new MyProjectCloseHandler());

  myBus = application.getMessageBus();
  InvocationHandler handler = (proxy, method, args) -> {
    multiCast(method, args);
    return null;
  };

  ClassLoader loader = FileDocumentManagerListener.class.getClassLoader();
  myMultiCaster = (FileDocumentManagerListener)Proxy.newProxyInstance(loader, new Class[]{FileDocumentManagerListener.class}, handler);
}
 
Example 3
Source File: TodoConfiguration.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Inject
public TodoConfiguration(@Nonnull Application application) {
  myMessageBus = application.getMessageBus();
  resetToDefaultTodoPatterns();
  myTopic = myMessageBus.syncPublisher(PROPERTY_CHANGE);
}
 
Example 4
Source File: RemoteServersManagerImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Inject
public RemoteServersManagerImpl(Application application) {
  myMessageBus = application.getMessageBus();
}
 
Example 5
Source File: LocalHistoryImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Inject
public LocalHistoryImpl(@Nonnull Application application) {
  myBus = application.getMessageBus();

  initComponent();
}
 
Example 6
Source File: PowerSaveMode.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Inject
public PowerSaveMode(Application application) {
  myBus = application.getMessageBus();
}
 
Example 7
Source File: NotificationsConfigurationImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Inject
public NotificationsConfigurationImpl(@Nonnull Application application) {
  myMessageBus = application.getMessageBus();
}