use of com.android.tools.idea.gradle.project.sync.hyperlink.OpenGradleSettingsHyperlink in project android by JetBrains.
the class GradleDslMethodNotFoundErrorHandler method getGradleSettingsHyperlink.
@NotNull
private static NotificationHyperlink getGradleSettingsHyperlink(@NotNull Project project) {
if (isUsingWrapper(project)) {
GradleWrapper gradleWrapper = GradleWrapper.find(project);
if (gradleWrapper != null) {
VirtualFile propertiesFile = gradleWrapper.getPropertiesFile();
if (propertiesFile != null) {
return new NotificationHyperlink("open.wrapper.file", "Open Gradle wrapper file") {
@Override
protected void execute(@NotNull Project project) {
OpenFileDescriptor descriptor = new OpenFileDescriptor(project, propertiesFile);
FileEditorManager.getInstance(project).openTextEditor(descriptor, true);
}
};
}
}
}
return new OpenGradleSettingsHyperlink();
}
use of com.android.tools.idea.gradle.project.sync.hyperlink.OpenGradleSettingsHyperlink in project android by JetBrains.
the class UnsupportedGradleVersionErrorHandler method getQuickFixHyperlinks.
@NotNull
public static List<NotificationHyperlink> getQuickFixHyperlinks(@NotNull Project project, @Nullable String gradleVersion) {
List<NotificationHyperlink> hyperlinks = new ArrayList<>();
GradleWrapper gradleWrapper = GradleWrapper.find(project);
if (gradleWrapper != null) {
// It is very likely that we need to fix the model version as well. Do everything in one shot.
NotificationHyperlink hyperlink = createIfProjectUsesGradleWrapper(project, gradleVersion);
if (hyperlink != null) {
hyperlinks.add(hyperlink);
}
} else {
GradleProjectSettings gradleProjectSettings = GradleProjectSettingsFinder.getInstance().findGradleProjectSettings(project);
if (gradleProjectSettings != null && gradleProjectSettings.getDistributionType() == DistributionType.LOCAL) {
hyperlinks.add(new CreateGradleWrapperHyperlink());
}
}
hyperlinks.add(new OpenGradleSettingsHyperlink());
return hyperlinks;
}
Aggregations