use of com.intellij.ui.EditorNotificationPanel in project go-lang-idea-plugin by go-lang-plugin-org.
the class GoFileIgnoredByBuildToolNotificationProvider method createMismatchedTargetPanel.
@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;
}
use of com.intellij.ui.EditorNotificationPanel in project go-lang-idea-plugin by go-lang-plugin-org.
the class WrongSdkConfigurationNotificationProvider method createEmptyGoPathPanel.
@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;
}
use of com.intellij.ui.EditorNotificationPanel in project android by JetBrains.
the class ProjectSyncStatusNotificationProvider method createNotificationPanel.
@Override
@Nullable
public EditorNotificationPanel createNotificationPanel(@NotNull VirtualFile file, @NotNull FileEditor fileEditor) {
NotificationPanel oldPanel = (NotificationPanel) fileEditor.getUserData(getKey());
NotificationPanel.Type newPanelType = notificationPanelType();
return (oldPanel != null && oldPanel.type == newPanelType) ? oldPanel : newPanelType.create(myProject);
}
use of com.intellij.ui.EditorNotificationPanel in project android by JetBrains.
the class AndroidProjectStructureConfigurable method syncStarted.
@Override
public void syncStarted(@NotNull Project project) {
if (myUiInitialized) {
myNotificationPanel.removeAll();
EditorNotificationPanel notification = new EditorNotificationPanel();
notification.setText("Gradle project sync in progress...");
myNotificationPanel.add(notification);
revalidateAndRepaint(myNotificationPanel);
}
}
use of com.intellij.ui.EditorNotificationPanel in project android by JetBrains.
the class AttachAndroidSdkSourcesNotificationProvider method createNotificationPanel.
@Override
@Nullable
public EditorNotificationPanel createNotificationPanel(@NotNull VirtualFile file, @NotNull FileEditor fileEditor) {
if (file.getFileType() != JavaClassFileType.INSTANCE) {
return null;
}
// Locate the java source of the class file, if not found, then it might come from a SDK.
if (JavaEditorFileSwapper.findSourceFile(myProject, file) == null) {
JdkOrderEntry jdkOrderEntry = findAndroidSdkEntryForFile(file);
if (jdkOrderEntry == null) {
return null;
}
Sdk sdk = jdkOrderEntry.getJdk();
String sdkHome = sdk.getHomePath();
if (sdkHome == null) {
return null;
}
if (sdk.getRootProvider().getFiles(OrderRootType.SOURCES).length > 0) {
return null;
}
AndroidPlatform platform = AndroidPlatform.getInstance(sdk);
if (platform == null) {
return null;
}
EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText("Sources for '" + jdkOrderEntry.getJdkName() + "' not found.");
panel.createActionLabel("Download", () -> {
List<String> requested = Lists.newArrayList();
requested.add(DetailsTypes.getSourcesPath(platform.getApiVersion()));
ModelWizardDialog dialog = SdkQuickfixUtils.createDialogForPaths(myProject, requested);
if (dialog != null && dialog.showAndGet()) {
updateSdkSourceRoot(sdk);
}
});
panel.createActionLabel("Refresh (if already downloaded)", () -> updateSdkSourceRoot(sdk));
return panel;
}
return null;
}
Aggregations