use of com.intellij.openapi.externalSystem.ExternalSystemConfigurableAware in project intellij-community by JetBrains.
the class OpenExternalSystemSettingsCallback method hyperlinkActivated.
@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
ExternalSystemManager<?, ?, ?, ?, ?> manager;
if (myLinkedProjectPath == null || !((manager = ExternalSystemApiUtil.getManager(mySystemId)) instanceof ExternalSystemConfigurableAware)) {
ShowSettingsUtil.getInstance().showSettingsDialog(myProject, mySystemId.getReadableName());
return;
}
final Configurable configurable = ((ExternalSystemConfigurableAware) manager).getConfigurable(myProject);
if (configurable instanceof AbstractExternalSystemConfigurable) {
ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable, () -> ((AbstractExternalSystemConfigurable) configurable).selectProject(myLinkedProjectPath));
}
}
use of com.intellij.openapi.externalSystem.ExternalSystemConfigurableAware in project intellij-community by JetBrains.
the class ExternalSystemNotificationManager method processExternalProjectRefreshError.
public void processExternalProjectRefreshError(@NotNull Throwable error, @NotNull String externalProjectName, @NotNull ProjectSystemId externalSystemId) {
if (myProject.isDisposed() || !myProject.isOpen()) {
return;
}
ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(externalSystemId);
if (!(manager instanceof ExternalSystemConfigurableAware)) {
return;
}
String title = ExternalSystemBundle.message("notification.project.refresh.fail.title", externalSystemId.getReadableName(), externalProjectName);
String message = ExternalSystemApiUtil.buildErrorMessage(error);
NotificationCategory notificationCategory = NotificationCategory.ERROR;
String filePath = null;
Integer line = null;
Integer column = null;
//noinspection ThrowableResultOfMethodCallIgnored
Throwable unwrapped = RemoteUtil.unwrap(error);
if (unwrapped instanceof LocationAwareExternalSystemException) {
LocationAwareExternalSystemException locationAwareExternalSystemException = (LocationAwareExternalSystemException) unwrapped;
filePath = locationAwareExternalSystemException.getFilePath();
line = locationAwareExternalSystemException.getLine();
column = locationAwareExternalSystemException.getColumn();
}
NotificationData notificationData = new NotificationData(title, message, notificationCategory, NotificationSource.PROJECT_SYNC, filePath, ObjectUtils.notNull(line, -1), ObjectUtils.notNull(column, -1), false);
for (ExternalSystemNotificationExtension extension : ExternalSystemNotificationExtension.EP_NAME.getExtensions()) {
final ProjectSystemId targetExternalSystemId = extension.getTargetExternalSystemId();
if (!externalSystemId.equals(targetExternalSystemId) && !targetExternalSystemId.equals(ProjectSystemId.IDE)) {
continue;
}
extension.customize(notificationData, myProject, error);
}
EditorNotifications.getInstance(myProject).updateAllNotifications();
showNotification(externalSystemId, notificationData);
}
Aggregations