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; }
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; } }