use of org.jetbrains.plugins.gradle.GradleManager in project intellij-community by JetBrains.
the class ConfigurationErrorEvent method process.
@Override
public void process(@NotNull final TestEventXmlView xml) throws TestEventXmlView.XmlParserException {
final String errorTitle = xml.getEventTitle();
final String configurationErrorMsg = xml.getEventMessage();
final boolean openSettings = xml.isEventOpenSettings();
final Project project = getProject();
assert project != null;
final String message = openSettings ? String.format("<br>\n%s<br><br>\n\n<a href=\"Gradle settings\">Open gradle settings</a>", configurationErrorMsg) : String.format("<br>\n%s", configurationErrorMsg);
GradleNotification.getInstance(project).showBalloon(errorTitle, message, NotificationType.WARNING, new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
notification.expire();
if ("Gradle settings".equals(event.getDescription())) {
ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(GradleConstants.SYSTEM_ID);
assert manager instanceof GradleManager;
GradleManager gradleManager = (GradleManager) manager;
Configurable configurable = gradleManager.getConfigurable(project);
ShowSettingsUtil.getInstance().editConfigurable(project, configurable);
} else {
BrowserUtil.browse(event.getDescription());
}
}
});
}
use of org.jetbrains.plugins.gradle.GradleManager in project android by JetBrains.
the class OpenGradleSettingsHyperlink method execute.
@Override
protected void execute(@NotNull Project project) {
ExternalSystemManager<?, ?, ?, ?, ?> manager = getManager(GRADLE_SYSTEM_ID);
assert manager instanceof GradleManager;
GradleManager gradleManager = (GradleManager) manager;
Configurable configurable = gradleManager.getConfigurable(project);
ShowSettingsUtil.getInstance().editConfigurable(project, configurable);
}
use of org.jetbrains.plugins.gradle.GradleManager in project intellij-community by JetBrains.
the class OpenGradleSettingsCallback method hyperlinkActivated.
@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(GradleConstants.SYSTEM_ID);
assert manager instanceof GradleManager;
GradleManager gradleManager = (GradleManager) manager;
final Configurable configurable = gradleManager.getConfigurable(myProject);
ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable);
}
use of org.jetbrains.plugins.gradle.GradleManager in project azure-tools-for-java by Microsoft.
the class GradleUtils method listGradleProjects.
public static List<ExternalProjectPojo> listGradleProjects(Project project) {
GradleManager manager = (GradleManager) ExternalSystemApiUtil.getManager(GradleConstants.SYSTEM_ID);
Map<ExternalProjectPojo, Collection<ExternalProjectPojo>> projects = manager.getLocalSettingsProvider().fun(project).getAvailableProjects();
return new ArrayList(projects.keySet());
}
Aggregations