Example usage for com.intellij.openapi.options ConfigurationException getTitle

List of usage examples for com.intellij.openapi.options ConfigurationException getTitle

Introduction

In this page you can find the example usage for com.intellij.openapi.options ConfigurationException getTitle.

Prototype

public String getTitle() 

Source Link

Usage

From source file:com.android.tools.idea.gradle.actions.ReImportProjectAction.java

License:Apache License

@Override
public void actionPerformed(final AnActionEvent e) {
    Project project = e.getProject();//from  w  w  w .  j  a v a2 s  .c  om
    if (project != null && isGradleProject(project)) {
        GradleImportNotificationListener.detachFromManager();
        BuildVariantView.getInstance(project).projectImportStarted();
        Presentation presentation = e.getPresentation();
        presentation.setEnabled(false);
        try {
            GradleProjectImporter.getInstance().reImportProject(project);
        } catch (ConfigurationException ex) {
            Messages.showErrorDialog(ex.getMessage(), ex.getTitle());
            LOG.info(ex);
        } finally {
            GradleImportNotificationListener.attachToManager();
            presentation.setEnabled(true);
        }
    }
}

From source file:com.android.tools.idea.gradle.project.AndroidGradleProjectComponent.java

License:Apache License

public void configureGradleProject(boolean reImportProject) {
    if (myDisposable != null) {
        return;//  www .  j  a  va  2 s .  com
    }
    myDisposable = new Disposable() {
        @Override
        public void dispose() {
        }
    };

    listenForProjectChanges(myProject, myDisposable);

    GradleImportNotificationListener.attachToManager();
    Projects.ensureExternalBuildIsEnabledForGradleProject(myProject);

    if (reImportProject) {
        Projects.setProjectBuildAction(myProject, Projects.BuildAction.SOURCE_GEN);
        try {
            // Prevent IDEA from refreshing project. We want to do it ourselves.
            myProject.putUserData(ExternalSystemDataKeys.NEWLY_IMPORTED_PROJECT, Boolean.TRUE);

            GradleProjectImporter.getInstance().reImportProject(myProject);
        } catch (ConfigurationException e) {
            Messages.showErrorDialog(e.getMessage(), e.getTitle());
            LOG.info(e);
        }
    }
}

From source file:com.android.tools.idea.gradle.project.sync.GradleSyncInvoker.java

License:Apache License

public void requestProjectSync(@NotNull Project project, @NotNull Request request,
        @Nullable GradleSyncListener listener) {
    if (GradleSyncState.getInstance(project).isSyncInProgress()) {
        return;// w  w w .j  a v  a2s .  co  m
    }
    if (isBuildInProgress(project)) {
        setSyncRequestedDuringBuild(project, true);
        return;
    }

    invokeAndWaitIfNeeded(() -> ensureToolWindowContentInitialized(project, GRADLE_SYSTEM_ID));
    Runnable syncTask = () -> {
        try {
            if (prepareProject(project, request, listener)) {
                sync(project, request, listener);
            }
        } catch (ConfigurationException e) {
            showErrorDialog(project, e.getMessage(), e.getTitle());
        }
    };

    if (request.isRunInBackground()) {
        invokeLaterIfProjectAlive(project, syncTask);
    } else {
        invokeAndWaitIfNeeded(syncTask);
    }
}

From source file:com.android.tools.idea.gradle.service.notification.FixGradleVersionInWrapperHyperlink.java

License:Apache License

@Override
protected void execute(@NotNull Project project) {
    String gradleVersion = GradleUtil.GRADLE_MINIMUM_VERSION;
    try {/*from   ww w .j  a  v a2  s .co m*/
        GradleUtil.updateGradleDistributionUrl(gradleVersion, myWrapperPropertiesFile);
        try {
            GradleProjectImporter.getInstance().reImportProject(project, null);
        } catch (ConfigurationException e) {
            Messages.showErrorDialog(e.getMessage(), e.getTitle());
            Logger.getInstance(FixGradleVersionInWrapperHyperlink.class).info(e);
        }
    } catch (IOException e) {
        String msg = String.format("Unable to update Gradle wrapper to use Gradle %1$s\n", gradleVersion);
        msg += e.getMessage();
        Messages.showErrorDialog(project, msg, "Quick Fix Failed");
    }
}

From source file:com.android.tools.idea.gradle.service.notification.SyncProjectHyperlink.java

License:Apache License

@Override
protected void execute(@NotNull Project project) {
    try {//from   w  w  w. j a va2  s  . c om
        GradleProjectImporter.getInstance().reImportProject(project, null);
    } catch (ConfigurationException e) {
        Messages.showErrorDialog(project, e.getMessage(), e.getTitle());
    }
}

From source file:com.android.tools.idea.structure.AndroidModuleStructureConfigurable.java

License:Apache License

@Override
public void apply() throws ConfigurationException {
    super.apply();
    try {/*from   w w w.  ja v  a  2  s  . c o  m*/
        GradleProjectImporter.getInstance().reImportProject(myProject, null);
    } catch (ConfigurationException ex) {
        Messages.showErrorDialog(ex.getMessage(), ex.getTitle());
        LOG.info(ex);
    }
}

From source file:com.google.idea.blaze.clwb.wizard2.BlazeNewProjectWizard.java

License:Open Source License

private boolean commitStepData(ProjectImportWizardStep step) {
    try {/*from w  w w .j ava2s  . com*/
        if (!step.validate()) {
            return false;
        }
    } catch (ConfigurationException e) {
        Messages.showErrorDialog(myContentPanel, e.getMessage(), e.getTitle());
        return false;
    }
    step.updateDataModel();
    return true;
}

From source file:com.intellij.ide.util.newProjectWizard.AddModuleWizard.java

License:Apache License

protected boolean commitStepData(final ModuleWizardStep step) {
    try {/*  www  .j a  v  a  2 s. c  o  m*/
        if (!step.validate()) {
            return false;
        }
    } catch (ConfigurationException e) {
        Messages.showErrorDialog(myCurrentProject, e.getMessage(), e.getTitle());
        return false;
    }
    step.updateDataModel();
    return true;
}

From source file:com.intellij.ide.util.projectWizard.SdkSettingsStep.java

License:Apache License

@Override
public boolean validate() throws ConfigurationException {
    if (mySdkComboBox.getSelectedSdk() == null) {
        if (Messages.showDialog(getNoSdkMessage(), IdeBundle.message("title.no.jdk.specified"),
                new String[] { CommonBundle.getYesButtonText(), CommonBundle.getNoButtonText() }, 1,
                Messages.getWarningIcon()) != Messages.YES) {
            return false;
        }/*  ww w.ja v  a2  s .  com*/
    }
    try {
        myModel.apply(null, true);
    } catch (ConfigurationException e) {
        //IDEA-98382 We should allow Next step if user has wrong SDK
        if (Messages.showDialog(e.getMessage() + "/nDo you want to proceed?", e.getTitle(),
                new String[] { CommonBundle.getYesButtonText(), CommonBundle.getNoButtonText() }, 1,
                Messages.getWarningIcon()) != Messages.YES) {
            return false;
        }
    }
    return true;
}

From source file:com.microsoft.intellij.ui.azureroles.CertificatesPanel.java

License:Open Source License

@Override
public boolean doOKAction() {
    try {//ww  w  .  j av  a  2 s.  co  m
        apply();
        return true;
    } catch (ConfigurationException e) {
        PluginUtil.displayErrorDialogAndLog(e.getTitle(), e.getMessage(), e);
        return false;
    }
}