Package org.springframework.roo.shell

Examples of org.springframework.roo.shell.Completion


            final Class<?> requiredType, final String originalUserInput,
            final String optionContext, final MethodTarget target) {
        for (final PgpKeyId candidate : pgpService.getDiscoveredKeyIds()) {
            final String id = candidate.getId();
            if (id.toUpperCase().startsWith(originalUserInput.toUpperCase())) {
                completions.add(new Completion(id));
            }
        }

        return false;
    }
View Full Code Here


    public boolean getAllPossibleValues(final List<Completion> completions,
            final Class<?> targetType, final String existingData,
            final String optionContext, final MethodTarget target) {
        for (final Pom pom : projectOperations.getPoms()) {
            for (final PhysicalPath physicalPath : pom.getPhysicalPaths()) {
                completions.add(new Completion(physicalPath.getLogicalPath()
                        .getName()));
            }
        }
        return false;
    }
View Full Code Here

                mockCustomJarPackaging, mockWarPackaging };
        when(mockPackagingProviderRegistry.getAllPackagingProviders())
                .thenReturn(Arrays.asList(providers));
        final List<Completion> expectedCompletions = new ArrayList<Completion>();
        for (final PackagingProvider provider : providers) {
            expectedCompletions.add(new Completion(provider.getId()
                    .toUpperCase()));
        }
        final List<Completion> completions = new ArrayList<Completion>();

        // Invoke
View Full Code Here

        final Collection<Completion> completions = new LinkedHashSet<Completion>();
        for (final Pom pom : projectOperations.getPoms()) {
            for (final JavaType javaType : typeLocationService
                    .getTypesForModule(pom)) {
                final String type = javaType.getFullyQualifiedTypeName();
                completions.add(new Completion(type.substring(0,
                        type.lastIndexOf('.'))));
            }
        }
        return completions;
    }
View Full Code Here

    public boolean getAllPossibleValues(final List<Completion> completions,
            final Class<?> requiredType, final String existingData,
            final String optionContext, final MethodTarget target) {
        for (final String currentTopic : hintOperations.getCurrentTopics()) {
            completions.add(new Completion(currentTopic));
        }
        return false;
    }
View Full Code Here

    private void addCompletion(final String moduleName,
            final List<Completion> completions) {
        final String nonEmptyModuleName = StringUtils.defaultIfEmpty(
                moduleName, ROOT_MODULE_SYMBOL);
        completions.add(new Completion(nonEmptyModuleName));
    }
View Full Code Here

    private void addCompletionsForOtherModuleNames(
            final List<Completion> completions, final Pom targetModule) {
        for (final String moduleName : projectOperations.getModuleNames()) {
            if (StringUtils.isNotBlank(moduleName)
                    && !moduleName.equals(targetModule.getModuleName())) {
                completions.add(new Completion(moduleName
                        + MODULE_PATH_SEPARATOR, decorate(moduleName
                        + MODULE_PATH_SEPARATOR, FG_CYAN), "Modules", 0));
            }
        }
    }
View Full Code Here

            final String formattedPrefix, final String topLevelPackage,
            final String basePackage) {
        final Collection<JavaType> typesInModule = getTypesForModule(
                optionContext, targetModule);
        if (typesInModule.isEmpty()) {
            completions.add(new Completion(prefix + targetModule.getGroupId(),
                    formattedPrefix + targetModule.getGroupId(), heading, 1));
        }
        else {
            completions.add(new Completion(prefix + topLevelPackage,
                    formattedPrefix + topLevelPackage, heading, 1));
            for (final JavaType javaType : typesInModule) {
                String type = javaType.getFullyQualifiedTypeName();
                if (type.startsWith(basePackage)) {
                    type = StringUtils.replace(type, topLevelPackage,
                            TOP_LEVEL_PACKAGE_SYMBOL, 1);
                    completions.add(new Completion(prefix + type,
                            formattedPrefix + type, heading, 1));
                }
            }
        }
    }
View Full Code Here

            types.add(Calendar.class.getName());
        }

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

            final Class<?> requiredType, final String existingData,
            final String optionContext, final MethodTarget target) {
        for (final Path candidate : Path.values()) {
            if ("".equals(existingData)
                    || candidate.name().startsWith(existingData)) {
                completions.add(new Completion(candidate.name()));
            }
        }
        return true;
    }
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.