public void setLibraryRootUrls(@NotNull Collection<String> libraryRootUrls) { if (!myState.getUrls().equals(libraryRootUrls)) { myState.setUrls(libraryRootUrls); incModificationCount(); ApplicationManager.getApplication().getMessageBus().syncPublisher(LIBRARIES_TOPIC).librariesChanged(libraryRootUrls); } }
public void setLibraryRootUrls(@NotNull Collection<String> libraryRootUrls) { if (!myState.getUrls().equals(libraryRootUrls)) { myState.setUrls(libraryRootUrls); incModificationCount(); ApplicationManager.getApplication().getMessageBus().syncPublisher(LIBRARIES_TOPIC) .librariesChanged(libraryRootUrls); } }
public void setUseGoPathFromSystemEnvironment(boolean useGoPathFromSystemEnvironment) { if (myState.isUseGoPathFromSystemEnvironment() != useGoPathFromSystemEnvironment) { myState.setUseGoPathFromSystemEnvironment(useGoPathFromSystemEnvironment); if (!GoSdkUtil.getGoPathsRootsFromEnvironment().isEmpty()) { incModificationCount(); ApplicationManager.getApplication().getMessageBus().syncPublisher(LIBRARIES_TOPIC).librariesChanged(getLibraryRootUrls()); } } }
public void setUseBallerinaPathFromSystemEnvironment(boolean useBallerinaPathFromSystemEnvironment) { if (myState.isUseBallerinaPathFromSystemEnvironment() != useBallerinaPathFromSystemEnvironment) { myState.setUseBallerinaPathFromSystemEnvironment(useBallerinaPathFromSystemEnvironment); if (!BallerinaSdkUtil.getBallerinaPathsRootsFromEnvironment().isEmpty()) { incModificationCount(); ApplicationManager.getApplication().getMessageBus().syncPublisher(LIBRARIES_TOPIC) .librariesChanged(getLibraryRootUrls()); } } }
/** * Preloading of the ballerina plugin. */ @Override public void preload(@NotNull ProgressIndicator indicator) { // Stops all running language server instances. stopProcesses(); // Registers language server definitions for initially opened projects. registerServerDefinition(); final MessageBusConnection connect = ApplicationManager.getApplication().getMessageBus().connect(); connect.subscribe(ProjectManager.TOPIC, new ProjectManagerListener() { @Override public void projectOpened(@Nullable final Project project) { registerServerDefinition(project); updateBallerinaPathModificationTracker(project, ProjectStatus.OPENED); } }); ProjectManager.getInstance().addProjectManagerListener(project -> { Project[] openProjects = ProjectManager.getInstance().getOpenProjects(); if (openProjects.length <= 1) { stopProcesses(); updateBallerinaPathModificationTracker(project, ProjectStatus.CLOSED); } return true; }); }
public Perl5SdkConfigurable(@NotNull Perl5SdkManipulator sdkManipulator, @NotNull Project project) { myConnection = ApplicationManager.getApplication().getMessageBus().connect(); mySdkManipulator = sdkManipulator; myProject = project; }
@Nullable protected static <L> L getListener(@NotNull Topic<L> topic) { if (canSendMessage()) { return ApplicationManager.getApplication().getMessageBus().syncPublisher(topic); } return null; }
public PerlSdkTable() { myMessageBus = ApplicationManager.getApplication().getMessageBus(); myListenerList = new MessageListenerList<>(myMessageBus, PERL_TABLE_TOPIC); }
static <E extends AbstractCacheUpdateEvent<E>> void abstractSendEvent( @NotNull Topic<? extends TopicListener<E>> topic, @NotNull E event) { if (canSendMessage()) { ApplicationManager.getApplication().getMessageBus().syncPublisher(topic).onEvent(event); } }
@NotNull public static ApplicationClient forApplication(@NotNull Disposable owner) { ApplicationClient ret = new ApplicationClient(ApplicationManager.getApplication().getMessageBus().connect(owner)); // Just to be sure... Disposer.register(owner, ret::close); return ret; } }
private void init() { final MessageBus myBus = ApplicationManager.getApplication().getMessageBus(); connection = myBus.connect(); connection.subscribe(AuthenticationNotifier.USER_LOGGED_IN, this); }
private void init() { final MessageBus myBus = ApplicationManager.getApplication().getMessageBus(); connection = myBus.connect(); connection.subscribe(AuthenticationNotifier.USER_LOGGED_IN, this); }
private void notifyLoginStatusChange() { GoogleLoginListener publisher = ApplicationManager.getApplication() .getMessageBus() .syncPublisher(GoogleLoginListener.GOOGLE_LOGIN_LISTENER_TOPIC); publisher.statusChanged(); } }
@Override public void initComponent() { MessageBusConnection busConnection = ApplicationManager.getApplication().getMessageBus().connect(this); busConnection.subscribe(ProjectManager.TOPIC, new ProjectListener()); }
public MakeTrigger(Project project, SonarLintSubmitter submitter, SonarLintConsole console) { super(project); this.submitter = submitter; this.console = console; MessageBusConnection busConnection = ApplicationManager.getApplication().getMessageBus().connect(project); busConnection.subscribe(BuildManagerListener.TOPIC, this); busConnection.subscribe(CompilerTopics.COMPILATION_STATUS, this); }
public SonarLintProjectConfigurable(Project project) { this.project = project; this.projectSettings = project.getComponent(SonarLintProjectSettings.class); this.busConnection = ApplicationManager.getApplication().getMessageBus().connect(project); this.busConnection.subscribe(GlobalConfigurationListener.TOPIC, new GlobalConfigurationListener.Adapter() { @Override public void changed(List<SonarQubeServer> newServerList) { if (panel != null) { panel.serversChanged(newServerList); } } }); }
public LoginService(final Project project) { this.project = project; final MessageBus myBus = ApplicationManager.getApplication().getMessageBus(); publisher = myBus.syncPublisher(AuthenticationNotifier.USER_LOGGED_IN); requestManager = RequestManager.getInstance(project); jenkinsSettings = JenkinsSettings.getSafeInstance(project); }
@Override public void initComponent() { disposable = Disposer.newDisposable(); Disposer.register(disposable, projectManagerListener); ApplicationManager.getApplication().getMessageBus().connect(disposable).subscribe( ProjectManager.TOPIC, projectManagerListener ); }
@Override public void initComponent() { LOGGER.info("Starting component: " + COMPONENT_NAME); SaveActionManager manager = SaveActionManager.getInstance(); manager.setStorageFactory(DEFAULT); manager.addProcessors(BuildProcessor.stream()); manager.addProcessors(GlobalProcessor.stream()); MessageBus bus = ApplicationManager.getApplication().getMessageBus(); MessageBusConnection connection = bus.connect(); connection.subscribe(FILE_DOCUMENT_SYNC, manager); }
@Override protected void activate() { tempFileWatchDog.start(); if (myVFSListener == null) { myVFSListener = new P4VFSListener(getProject(), this); } // VcsCompat.getInstance().setupPlugin(myProject); ChangeListManager.getInstance(myProject).addChangeListListener(changelistListener); projectMessageBusConnection = myProject.getMessageBus().connect(); appMessageBusConnection = ApplicationManager.getApplication().getMessageBus().connect(); // If additional actions need to happen at plugin startup time, add them here to execute in // a background thread. }