@Override public void rootsChanged(ModuleRootEvent event) { notifications.updateAllNotifications(); } });
@Override public void rootsChanged(ModuleRootEvent event) { notifications.updateAllNotifications(); } });
public WrongSdkConfigurationNotificationProvider(@NotNull Project project, @NotNull EditorNotifications notifications) { myProject = project; MessageBusConnection connection = myProject.getMessageBus().connect(project); connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootAdapter() { @Override public void rootsChanged(ModuleRootEvent event) { notifications.updateAllNotifications(); } }); connection.subscribe(GoLibrariesService.LIBRARIES_TOPIC, newRootUrls -> notifications.updateAllNotifications()); }
public GoFileIgnoredByBuildToolNotificationProvider(@NotNull Project project, @NotNull EditorNotifications notifications, @NotNull FileEditorManager fileEditorManager) { myProject = project; MessageBusConnection connection = myProject.getMessageBus().connect(myProject); connection.subscribe(GoModuleSettings.TOPIC, module -> notifications.updateAllNotifications()); connection.subscribe(VirtualFileManager.VFS_CHANGES, new BulkFileListener.Adapter() { @Override public void after(@NotNull List<? extends VFileEvent> events) { if (!myProject.isDisposed()) { Set<VirtualFile> openFiles = ContainerUtil.newHashSet(fileEditorManager.getSelectedFiles()); for (VFileEvent event : events) { VirtualFile file = event.getFile(); if (file != null && openFiles.contains(file)) { notifications.updateNotifications(file); } } } } }); }
public WrongSdkConfigurationNotificationProvider(@NotNull Project project, @NotNull EditorNotifications notifications) { myProject = project; MessageBusConnection connection = myProject.getMessageBus().connect(project); connection.subscribe(ProjectTopics.PROJECT_ROOTS, new ModuleRootListener() { @Override public void rootsChanged(ModuleRootEvent event) { notifications.updateAllNotifications(); } }); connection.subscribe(BallerinaLibrariesService.LIBRARIES_TOPIC, newRootUrls -> notifications.updateAllNotifications()); }
private static EditorNotificationPanel createIgnoredByBuildToolPanel(@NotNull Project project, @NotNull VirtualFile file) { EditorNotificationPanel panel = new EditorNotificationPanel(); String fileName = file.getName(); panel.setText("'" + fileName + "' will be ignored by build tool since its name starts with '" + fileName.charAt(0) + "'"); panel.createActionLabel("Do not show again", () -> { PropertiesComponent.getInstance().setValue(DO_NOT_SHOW_NOTIFICATION_ABOUT_IGNORE_BY_BUILD_TOOL, true); EditorNotifications.getInstance(project).updateAllNotifications(); }); return panel; }
@NotNull private static EditorNotificationPanel createEmptyGoPathPanel(@NotNull Project project) { EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText("GOPATH is empty"); panel.createActionLabel("Configure Go Libraries", () -> GoLibrariesConfigurableProvider.showModulesConfigurable(project)); panel.createActionLabel("Do not show again", () -> { PropertiesComponent.getInstance().setValue(DO_NOT_SHOW_NOTIFICATION_ABOUT_EMPTY_GOPATH, true); EditorNotifications.getInstance(project).updateAllNotifications(); }); return panel; } }
@NotNull private static EditorNotificationPanel createPanel(@NotNull Project project, @NotNull Module module) { EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText("'" + module.getName() + "' is not Go Module, some code insight might not work here"); panel.createActionLabel("Change module type to Go and reload project", () -> { int message = Messages.showOkCancelDialog(project, "Updating module type requires project reload. Proceed?", "Update Module Type", "Reload project", "Cancel", null); if (message == Messages.YES) { module.setOption(Module.ELEMENT_TYPE, GoModuleType.getInstance().getId()); project.save(); EditorNotifications.getInstance(project).updateAllNotifications(); ProjectManager.getInstance().reloadProject(project); } }); panel.createActionLabel("Don't show again for this module", () -> { Set<String> ignoredModules = getIgnoredModules(project); ignoredModules.add(module.getName()); PropertiesComponent.getInstance(project).setValue(DONT_ASK_TO_CHANGE_MODULE_TYPE_KEY, StringUtil.join(ignoredModules, ",")); EditorNotifications.getInstance(project).updateAllNotifications(); }); return panel; }
panel.createActionLabel(IgnoreBundle.message("daemon.ok"), () -> { Properties.setDismissedIgnoredEditingNotification(project, file); notifications.updateAllNotifications(); });
notifications.updateAllNotifications(); notifications.updateAllNotifications(); });
panel.createActionLabel(IgnoreBundle.message("daemon.cancel"), () -> { Properties.setIgnoreMissingGitignore(project); notifications.updateAllNotifications(); });
public void settingsUpdated() { changeCounter++; if (!ApplicationManager.getApplication().isUnitTestMode()) { EditorNotifications.getInstance(myProject).updateAllNotifications(); } }
EditorNotifications.getInstance(myProject).updateAllNotifications(); });
@Nullable @Override public EditorNotificationPanel createNotificationPanel(@NotNull VirtualFile virtualFile, @NotNull FileEditor fileEditor) { if (virtualFile.getFileType() instanceof PerlFileType && !(virtualFile instanceof LightVirtualFile)) { final PerlLocalSettings perlLocalSettings = PerlLocalSettings.getInstance(myProject); if (perlLocalSettings.DISABLE_NO_INTERPRETER_WARNING) { return null; } if (PerlProjectManager.getSdk(myProject, virtualFile) != null) { return null; } EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText(PerlBundle.message("perl.notification.sdk.not.configured")); panel.createActionLabel(PerlBundle.message("perl.notification.configure"), () -> Perl5SettingsConfigurable.open(myProject)); panel.createActionLabel(PerlBundle.message("perl.notification.disable.notification"), () -> { perlLocalSettings.DISABLE_NO_INTERPRETER_WARNING = true; EditorNotifications.getInstance(myProject).updateAllNotifications(); }); return panel; } return null; } }