Example usage for com.intellij.openapi.ui NamedConfigurable getDisplayName

List of usage examples for com.intellij.openapi.ui NamedConfigurable getDisplayName

Introduction

In this page you can find the example usage for com.intellij.openapi.ui NamedConfigurable getDisplayName.

Prototype

@Nls(capitalization = Nls.Capitalization.Title)
@Contract(pure = true)
String getDisplayName();

Source Link

Document

Returns the visible name of the configurable component.

Usage

From source file:com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable.java

License:Apache License

@Override
protected void checkApply(Set<MyNode> rootNodes, String prefix, String title) throws ConfigurationException {
    super.checkApply(rootNodes, prefix, title);
    final Set<String> predefinedScopes = new HashSet<String>();
    for (CustomScopesProvider scopesProvider : myProject
            .getExtensions(CustomScopesProvider.CUSTOM_SCOPES_PROVIDER)) {
        for (NamedScope namedScope : scopesProvider.getCustomScopes()) {
            predefinedScopes.add(namedScope.getName());
        }/*w  ww . ja  va  2s  .c  om*/
    }
    for (MyNode rootNode : rootNodes) {
        for (int i = 0; i < rootNode.getChildCount(); i++) {
            final MyNode node = (MyNode) rootNode.getChildAt(i);
            final NamedConfigurable scopeConfigurable = node.getConfigurable();
            final String name = scopeConfigurable.getDisplayName();
            if (predefinedScopes.contains(name)) {
                selectNodeInTree(node);
                throw new ConfigurationException("Scope name equals to predefined one",
                        ProjectBundle.message("rename.scope.title"));
            }
        }
    }
}