Examples of Completion


Examples of org.springframework.roo.shell.Completion

            final Bundle[] bundles = context.getBundleContext().getBundles();
            if (bundles != null) {
                for (final Bundle bundle : bundles) {
                    final String bsn = bundle.getSymbolicName();
                    if (bsn != null && bsn.startsWith(originalUserInput)) {
                        completions.add(new Completion(bsn));
                    }
                }
            }
        }

        if (obr) {
            final Repository[] repositories = repositoryAdmin
                    .listRepositories();
            if (repositories != null) {
                for (final Repository repository : repositories) {
                    final Resource[] resources = repository.getResources();
                    if (resources != null) {
                        for (final Resource resource : resources) {
                            if (resource.getSymbolicName().startsWith(
                                    originalUserInput)) {
                                completions.add(new Completion(resource
                                        .getSymbolicName()));
                            }
                        }
                    }
                }
View Full Code Here

Examples of org.springframework.roo.shell.Completion

        final Map<String, Field> ffields = fields.get(requiredType);
        if (ffields == null) {
            return true;
        }
        for (final String field : ffields.keySet()) {
            completions.add(new Completion(field));
        }
        return true;
    }
View Full Code Here

Examples of org.springframework.roo.shell.Completion

            final String optionContext, final MethodTarget target) {
        try {
            if (dbreModelService.supportsSchema(false)) {
                final Set<Schema> schemas = dbreModelService.getSchemas(false);
                for (final Schema schema : schemas) {
                    completions.add(new Completion(schema.getName()));
                }
            }
            else {
                completions.add(new Completion(
                        DbreModelService.NO_SCHEMA_REQUIRED));
            }
        }
        catch (final Exception e) {
            completions.add(new Completion("unable-to-obtain-connection"));
        }

        return true;
    }
View Full Code Here

Examples of org.springframework.roo.shell.Completion

                completion = convertCompletionBackIntoUserInputStyle(
                        originalUserInput, completion);

                if (file.isDirectory()) {
                    completions
                            .add(new Completion(completion + File.separator));
                }
                else {
                    completions.add(new Completion(completion));
                }
            }
        }
    }
View Full Code Here

Examples of org.springframework.roo.shell.Completion

    }

    public boolean getAllPossibleValues(final List<Completion> completions,
            final Class<?> requiredType, final String existingData,
            final String optionContext, final MethodTarget target) {
        completions.add(new Completion("true"));
        completions.add(new Completion("false"));
        completions.add(new Completion("yes"));
        completions.add(new Completion("no"));
        completions.add(new Completion("1"));
        completions.add(new Completion("0"));
        return false;
    }
View Full Code Here

Examples of org.springframework.roo.shell.Completion

                    || existingData.startsWith(candidate)
                    || candidate.toUpperCase().startsWith(
                            existingData.toUpperCase())
                    || existingData.toUpperCase().startsWith(
                            candidate.toUpperCase())) {
                completions.add(new Completion(candidate));
            }
        }
        return true;
    }
View Full Code Here

Examples of org.springframework.roo.shell.Completion

            final SimpleParser cmd = (SimpleParser) target.getTarget();

            // Only include the first word of each command
            for (final String s : cmd.getEveryCommand()) {
                if (s.contains(" ")) {
                    completions.add(new Completion(s.substring(0,
                            s.indexOf(" "))));
                }
                else {
                    completions.add(new Completion(s));
                }
            }
        }
        return true;
    }
View Full Code Here

Examples of org.springframework.roo.shell.Completion

        types.add(BigInteger.class.getName());
        types.add("org.bson.types.ObjectId");

        for (final String type : types) {
            if (type.startsWith(existingData) || existingData.startsWith(type)) {
                completions.add(new Completion(type));
            }
        }
        return false;
    }
View Full Code Here

Examples of org.springframework.roo.shell.Completion

                    locale.getLanguage());
            if (locale.getCountry() == null || locale.getCountry().length() > 0) {
                localeString.append("_").append(
                        locale.getCountry().toUpperCase());
            }
            completions.add(new Completion(localeString.toString()));
        }
        return true;
    }
View Full Code Here

Examples of org.springframework.roo.shell.Completion

            Class<?> targetType, String existingData, String optionContext,
            MethodTarget target) {
        for (final CloudProviderId id : operations.getProvidersId()) {
            if (existingData.isEmpty() || id.getId().equals(existingData)
                    || id.getId().startsWith(existingData)) {
                completions.add(new Completion(id.getId()));
            }
        }
        return true;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.