@NotNull private static EditorNotificationPanel createPanel(@NotNull Module module, @NotNull String sdkVersion, @NotNull String pluginVersion) { EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText("Your Ballerina SDK version (" + sdkVersion + ") for the Module '" + module.getName() + "' does not match your Ballerina plugin version (" + pluginVersion + "). Some features may " + "not work properly."); return panel; } }
@NotNull private static EditorNotificationPanel createMismatchedTargetPanel(@NotNull Module module, @NotNull VirtualFile file) { EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText("'" + file.getName() + "' doesn't match to target system. File will be ignored by build tool"); panel.createActionLabel("Edit Go project settings", () -> GoModuleSettings.showModulesConfigurable(module)); return panel; } }
@NotNull private static EditorNotificationPanel createPanel(@NotNull Project project, @NotNull Module module) { EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText("'" + module.getName() + "' is not a Ballerina Module. Some features will not work."); panel.setToolTipText("You can fix this by navigating to File -> Project Structure -> Modules and adding '" + module.getName() + "' as a Ballerina module."); return panel; }
@NotNull private static EditorNotificationPanel createMissingSdkPanel(@NotNull Project project, @Nullable Module module) { EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText(ProjectBundle.message("project.sdk.not.defined")); panel.createActionLabel(ProjectBundle.message("project.sdk.setup"), () -> GoSdkService.getInstance(project).chooseAndSetSdk(module)); return panel; }
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 createMissingSdkPanel(@NotNull Project project, @Nullable Module module) { EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText(ProjectBundle.message("project.sdk.not.defined") + ". Some of the plugin features are disabled."); panel.createActionLabel(ProjectBundle.message("project.sdk.setup"), () -> BallerinaSdkService.getInstance(project).chooseAndSetSdk(module)); 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; } }
final EditorNotificationPanel panel = new EditorNotificationPanel();
@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; }
final EditorNotificationPanel panel = new EditorNotificationPanel(); final IgnoreFileType fileType = GitFileType.INSTANCE; panel.setText(IgnoreBundle.message("daemon.addUnversionedFiles"));
final EditorNotificationPanel panel = new EditorNotificationPanel(); final IgnoreFileType fileType = GitFileType.INSTANCE; panel.setText(IgnoreBundle.message("daemon.missingGitignore"));
@Nullable @Override public EditorNotificationPanel createNotificationPanel(@NotNull VirtualFile file, @NotNull FileEditor fileEditor) { if (file.getFileType() == TemplateToolkitFileType.INSTANCE) { TemplateToolkitSettings settings = TemplateToolkitSettings.getInstance(myProject); if (!settings.isVirtualFileUnderRoot(file)) { EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText(TemplateToolkitBundle.message("tt2.error.file.not.in.root")); panel.createActionLabel("Configure", () -> Perl5SettingsConfigurable.open(myProject)); return panel; } } return null; } }
@Nullable @Override public EditorNotificationPanel createNotificationPanel(@NotNull final VirtualFile file, @NotNull FileEditor fileEditor) { if (file.getFileType() == HTMLMasonFileType.INSTANCE) { String message = null; if (HTMLMasonSettings.getInstance(myProject).getComponentsRoots().isEmpty()) { message = "HTML::Mason components roots are not configured"; } else { PsiFile psiFile = PsiManager.getInstance(myProject).findFile(file); if (psiFile instanceof HTMLMasonFileImpl && ((HTMLMasonFileImpl)psiFile).getComponentRoot() == null) { message = "Component is not under one of configured roots"; } } if (message != null) { EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText(message); panel.createActionLabel("Configure", () -> Perl5SettingsConfigurable.open(myProject)); return panel; } } return null; } }
@Nullable @Override public EditorNotificationPanel createNotificationPanel(@NotNull final VirtualFile file, @NotNull FileEditor fileEditor) { if (file.getFileType() instanceof MasonPurePerlComponentFileType) { String message = null; if (MasonSettings.getInstance(myProject).getComponentsRoots().isEmpty()) { message = "Mason2 components roots are not configured"; } else { PsiFile psiFile = PsiManager.getInstance(myProject).findFile(file); if (psiFile instanceof MasonFileImpl && ((MasonFileImpl)psiFile).getComponentRoot() == null) { message = "Component is not under one of configured roots"; } } if (message != null) { EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText(message); panel.createActionLabel("Configure", () -> Perl5SettingsConfigurable.open(myProject)); return panel; } } return null; } }
EditorNotificationPanel panel = new EditorNotificationPanel(); panel.setText(PerlBundle.message("perl.notification.wrong.association", matchedEntry.get().getKey(),
@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; } }