use of com.intellij.ui.EditorNotificationPanel in project Perl5-IDEA by Camelcade.
the class MasonPathsNotification method createNotificationPanel.
@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;
}
use of com.intellij.ui.EditorNotificationPanel in project Perl5-IDEA by Camelcade.
the class HTMLMasonPathsNotification method createNotificationPanel.
@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;
}
use of com.intellij.ui.EditorNotificationPanel in project intellij by bazelbuild.
the class AdditionalLanguagesHelper method createNotificationPanel.
@Nullable
@Override
public EditorNotificationPanel createNotificationPanel(VirtualFile file, FileEditor fileEditor) {
String ext = file.getExtension();
if (ext == null) {
return null;
}
LanguageClass language = LanguageClass.fromExtension(ext);
if (language == null || notifiedLanguages.contains(language)) {
return null;
}
BlazeProjectData projectData = BlazeProjectDataManager.getInstance(project).getBlazeProjectData();
if (projectData == null) {
return null;
}
WorkspaceLanguageSettings settings = projectData.workspaceLanguageSettings;
if (settings.isLanguageActive(language)) {
return null;
}
if (!LanguageSupport.supportedLanguagesForWorkspaceType(settings.getWorkspaceType()).contains(language)) {
return null;
}
String langName = language.getName();
String message = String.format("Do you want to enable %s plugin %s support?", Blaze.buildSystemName(project), langName);
EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(message);
panel.createActionLabel(String.format("Enable %s support", langName), () -> {
enableLanguageSupport(project, ImmutableList.of(language));
suppressNotifications(language);
});
panel.createActionLabel("Don't show again", () -> suppressNotifications(language));
return panel;
}
use of com.intellij.ui.EditorNotificationPanel in project flutter-intellij by flutter.
the class IncompatibleDartPluginNotificationProvider method createUpdateDartPanel.
@Nullable
private static EditorNotificationPanel createUpdateDartPanel(@NotNull Project project, @Nullable Module module, @NotNull String currentVersion, @NotNull String minimumVersion) {
if (module == null)
return null;
final EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText(FlutterBundle.message("flutter.incompatible.dart.plugin.warning", minimumVersion, currentVersion));
panel.createActionLabel(FlutterBundle.message("dart.plugin.update.action.label"), () -> ShowSettingsUtil.getInstance().showSettingsDialog(project, PluginManagerConfigurable.class));
return panel;
}
use of com.intellij.ui.EditorNotificationPanel in project flutter-intellij by flutter.
the class SdkConfigurationNotificationProvider method createOutOfDateFlutterSdkPanel.
private EditorNotificationPanel createOutOfDateFlutterSdkPanel(@NotNull FlutterSdk sdk) {
final FlutterUIConfig settings = FlutterUIConfig.getInstance();
if (settings.shouldIgnoreOutOfDateFlutterSdks())
return null;
final EditorNotificationPanel panel = new EditorNotificationPanel();
panel.icon(FlutterIcons.Flutter);
panel.setText(FlutterBundle.message("flutter.old.sdk.warning"));
panel.createActionLabel("Dismiss", () -> {
settings.setIgnoreOutOfDateFlutterSdks();
panel.setVisible(false);
});
return panel;
}
Aggregations