Search in sources :

Example 1 with PlatformModifiableModelsProvider

use of com.intellij.openapi.roots.PlatformModifiableModelsProvider in project intellij-community by JetBrains.

the class FrameworkDetectionManager method showSetupFrameworksDialog.

private void showSetupFrameworksDialog(Notification notification) {
    List<? extends DetectedFrameworkDescription> descriptions;
    try {
        descriptions = getValidDetectedFrameworks();
    } catch (IndexNotReadyException e) {
        DumbService.getInstance(myProject).showDumbModeNotification("Information about detected frameworks is not available until indices are built");
        return;
    }
    if (descriptions.isEmpty()) {
        Messages.showInfoMessage(myProject, "No frameworks are detected", "Framework Detection");
        return;
    }
    final ConfigureDetectedFrameworksDialog dialog = new ConfigureDetectedFrameworksDialog(myProject, descriptions);
    if (dialog.showAndGet()) {
        notification.expire();
        List<DetectedFrameworkDescription> selected = dialog.getSelectedFrameworks();
        FrameworkDetectionUtil.setupFrameworks(selected, new PlatformModifiableModelsProvider(), new DefaultModulesProvider(myProject));
        for (DetectedFrameworkDescription description : selected) {
            final int detectorId = FrameworkDetectorRegistry.getInstance().getDetectorId(description.getDetector());
            myDetectedFrameworksData.putExistentFrameworkFiles(detectorId, description.getRelatedFiles());
        }
    }
}
Also used : ConfigureDetectedFrameworksDialog(com.intellij.framework.detection.impl.ui.ConfigureDetectedFrameworksDialog) DefaultModulesProvider(com.intellij.openapi.roots.ui.configuration.DefaultModulesProvider) DetectedFrameworkDescription(com.intellij.framework.detection.DetectedFrameworkDescription) PlatformModifiableModelsProvider(com.intellij.openapi.roots.PlatformModifiableModelsProvider) IndexNotReadyException(com.intellij.openapi.project.IndexNotReadyException)

Aggregations

DetectedFrameworkDescription (com.intellij.framework.detection.DetectedFrameworkDescription)1 ConfigureDetectedFrameworksDialog (com.intellij.framework.detection.impl.ui.ConfigureDetectedFrameworksDialog)1 IndexNotReadyException (com.intellij.openapi.project.IndexNotReadyException)1 PlatformModifiableModelsProvider (com.intellij.openapi.roots.PlatformModifiableModelsProvider)1 DefaultModulesProvider (com.intellij.openapi.roots.ui.configuration.DefaultModulesProvider)1