Example usage for org.springframework.ide.eclipse.boot.wizard.importing ImportStrategy getNotInstalledMessage

List of usage examples for org.springframework.ide.eclipse.boot.wizard.importing ImportStrategy getNotInstalledMessage

Introduction

In this page you can find the example usage for org.springframework.ide.eclipse.boot.wizard.importing ImportStrategy getNotInstalledMessage.

Prototype

public final String getNotInstalledMessage() 

Source Link

Document

Subclasses should override to provide more precise message

Usage

From source file:org.springframework.ide.eclipse.boot.wizard.NewSpringBootWizardModel.java

/**
 * If this wizard has a 'type' radioGroup to select the build type then add a validator to check if the
 * build type is supported.//www.ja v a  2 s .  com
 */
private void addBuildTypeValidator() {
    final RadioGroup buildTypeGroup = getRadioGroups().getGroup("type");
    if (buildTypeGroup != null) {
        buildTypeGroup.validator(new Validator() {
            {
                dependsOn(buildTypeGroup.getVariable());
            }

            @Override
            protected ValidationResult compute() {
                ImportStrategy s = getImportStrategy();
                if (s == null) {
                    return ValidationResult.error("No 'type' selected");
                } else if (!s.isSupported()) {
                    //This means some required STS component like m2e or gradle tooling is not installed
                    return ValidationResult.error(s.getNotInstalledMessage());
                }
                return ValidationResult.OK;
            }
        });
    }
}