Package org.springframework.roo.shell

Examples of org.springframework.roo.shell.Completion


    public boolean getAllPossibleValues(final List<Completion> completions,
            final Class<?> targetType, final String existingData,
            final String optionContext, final MethodTarget target) {
        for (final PackagingProvider packagingProvider : packagingProviderRegistry
                .getAllPackagingProviders()) {
            completions.add(new Completion(packagingProvider.getId()
                    .toUpperCase()));
        }
        return true;
    }
View Full Code Here


        for (final Entry<String, Bundle> entry : bundles.entrySet()) {
            final String bsn = entry.getKey();
            final Bundle bundle = entry.getValue();
            if (bundle.getVersions().size() > 1) {
                for (final BundleVersion bundleVersion : bundle.getVersions()) {
                    completions.add(new Completion(bsn + ";"
                            + bundleVersion.getVersion()));
                }
            }
            completions.add(new Completion(bsn));
        }
        return false;
    }
View Full Code Here

            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

        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

            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

                completion = convertCompletionBackIntoUserInputStyle(
                        originalUserInput, completion);

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

    }

    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

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

            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

        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

TOP

Related Classes of org.springframework.roo.shell.Completion

Copyright © 2018 www.massapicom. 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.