Search in sources :

Example 1 with BuildProjectHyperlink

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

the class ObjectStreamErrorHandler method findAndAddQuickFixes.

private static void findAndAddQuickFixes(@NotNull NotificationData notification, @NotNull Project project, @NotNull String text) {
    List<NotificationHyperlink> hyperlinks = new ArrayList<>();
    NotificationHyperlink buildProjectHyperlink = new BuildProjectHyperlink();
    NotificationHyperlink openAndroidSdkManagerHyperlink = new OpenAndroidSdkManagerHyperlink();
    text += "Please try one of the following:<ul>" + "<li>" + buildProjectHyperlink.toHtml() + " to obtain the cause of the error</li>" + "<li>" + openAndroidSdkManagerHyperlink.toHtml() + " to check if there are any missing components</li></ul>";
    hyperlinks.add(buildProjectHyperlink);
    hyperlinks.add(openAndroidSdkManagerHyperlink);
    notification.setTitle(SyncMessage.DEFAULT_GROUP);
    notification.setMessage(text);
    notification.setNotificationCategory(NotificationCategory.convert(DEFAULT_NOTIFICATION_TYPE));
    SyncMessages.getInstance(project).addNotificationListener(notification, hyperlinks);
}
Also used : OpenAndroidSdkManagerHyperlink(com.android.tools.idea.gradle.project.sync.hyperlink.OpenAndroidSdkManagerHyperlink) BuildProjectHyperlink(com.android.tools.idea.gradle.project.sync.hyperlink.BuildProjectHyperlink) ArrayList(java.util.ArrayList) NotificationHyperlink(com.android.tools.idea.gradle.project.sync.hyperlink.NotificationHyperlink)

Aggregations

BuildProjectHyperlink (com.android.tools.idea.gradle.project.sync.hyperlink.BuildProjectHyperlink)1 NotificationHyperlink (com.android.tools.idea.gradle.project.sync.hyperlink.NotificationHyperlink)1 OpenAndroidSdkManagerHyperlink (com.android.tools.idea.gradle.project.sync.hyperlink.OpenAndroidSdkManagerHyperlink)1 ArrayList (java.util.ArrayList)1