Search in sources :

Example 1 with CreateGradleWrapperHyperlink

use of com.android.tools.idea.gradle.project.sync.hyperlink.CreateGradleWrapperHyperlink in project android by JetBrains.

the class Gradle2RequiredErrorHandler method getQuickFixHyperlinks.

@Override
@NotNull
protected List<NotificationHyperlink> getQuickFixHyperlinks(@NotNull NotificationData notification, @NotNull Project project, @NotNull String text) {
    List<NotificationHyperlink> hyperlinks = new ArrayList<>();
    hyperlinks.add(new CreateGradleWrapperHyperlink());
    return hyperlinks;
}
Also used : ArrayList(java.util.ArrayList) NotificationHyperlink(com.android.tools.idea.gradle.project.sync.hyperlink.NotificationHyperlink) CreateGradleWrapperHyperlink(com.android.tools.idea.gradle.project.sync.hyperlink.CreateGradleWrapperHyperlink) NotNull(org.jetbrains.annotations.NotNull)

Example 2 with CreateGradleWrapperHyperlink

use of com.android.tools.idea.gradle.project.sync.hyperlink.CreateGradleWrapperHyperlink 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;
}
Also used : OpenGradleSettingsHyperlink(com.android.tools.idea.gradle.project.sync.hyperlink.OpenGradleSettingsHyperlink) GradleProjectSettings(org.jetbrains.plugins.gradle.settings.GradleProjectSettings) ArrayList(java.util.ArrayList) GradleWrapper(com.android.tools.idea.gradle.util.GradleWrapper) FixGradleVersionInWrapperHyperlink.createIfProjectUsesGradleWrapper(com.android.tools.idea.gradle.project.sync.hyperlink.FixGradleVersionInWrapperHyperlink.createIfProjectUsesGradleWrapper) NotificationHyperlink(com.android.tools.idea.gradle.project.sync.hyperlink.NotificationHyperlink) CreateGradleWrapperHyperlink(com.android.tools.idea.gradle.project.sync.hyperlink.CreateGradleWrapperHyperlink) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

CreateGradleWrapperHyperlink (com.android.tools.idea.gradle.project.sync.hyperlink.CreateGradleWrapperHyperlink)2 NotificationHyperlink (com.android.tools.idea.gradle.project.sync.hyperlink.NotificationHyperlink)2 ArrayList (java.util.ArrayList)2 NotNull (org.jetbrains.annotations.NotNull)2 FixGradleVersionInWrapperHyperlink.createIfProjectUsesGradleWrapper (com.android.tools.idea.gradle.project.sync.hyperlink.FixGradleVersionInWrapperHyperlink.createIfProjectUsesGradleWrapper)1 OpenGradleSettingsHyperlink (com.android.tools.idea.gradle.project.sync.hyperlink.OpenGradleSettingsHyperlink)1 GradleWrapper (com.android.tools.idea.gradle.util.GradleWrapper)1 GradleProjectSettings (org.jetbrains.plugins.gradle.settings.GradleProjectSettings)1