Package org.springframework.shell.core

Examples of org.springframework.shell.core.Completion


  @Override
  public boolean getAllPossibleValues(List<Completion> completions, Class<?> targetType, String existingData, String optionContext, MethodTarget target) {
    Set<String> hosts = client.getHostNames().keySet();
    for (String host : hosts) {
      completions.add(new Completion(host));
    }
    return true;
  }
View Full Code Here


  @Override
  public boolean getAllPossibleValues(List<Completion> completions, Class<?> targetType, String existingData, String optionContext, MethodTarget target) {
    Set<String> blueprints = client.getBlueprintsMap().keySet();
    for (String blueprint : blueprints) {
      completions.add(new Completion(blueprint));
    }
    return true;
  }
View Full Code Here

                                      String existingData,
                                      String optionContext,
                                      MethodTarget target) {
    for(Map.Entry<String, String> entry : discoveryCmds.getResources().entrySet()) {
      if(entry.getKey().startsWith(existingData)) {
        completions.add(new Completion(entry.getKey()));
      }
    }
    return true;
  }
View Full Code Here

  private void populate(List<Completion> completions, Iterable<? extends NamedResource> resources,
      DeployedCriteria criteria, String kind) {
    for (NamedResource named : resources) {
      if (criteria.matches(named)) {
        completions.add(new Completion(named.getName(), named.getName(), criteria.heading(named, kind), 0));
      }
    }
  }
View Full Code Here

  @Override
  public boolean getAllPossibleValues(List<Completion> completions, Class<?> targetType, String existingData,
      String optionContext, MethodTarget target) {
    for (ModuleDefinitionResource m : xdShell.getSpringXDOperations().moduleOperations().list(null)) {
      String value = m.getType() + ":" + m.getName();
      completions.add(new Completion(value, m.getName(), pretty(m.getType()), 0));
    }
    return true;

  }
View Full Code Here

    CompletionKind kind = determineKind(optionContext);
    try {
      int successiveInvocations = determinceNumberOfInvocations(optionContext);
      List<String> candidates = completionOperations().completions(kind, start, successiveInvocations);
      for (String candidate : candidates) {
        completions.add(new Completion(candidate));
      }
      return false;
    }
    // Protect from exception in non-command code
    catch (Exception e) {
View Full Code Here

  @Override
  public boolean getAllPossibleValues(final List<Completion> completions, final Class<?> requiredType,
      final String existingData, final String optionContext, final MethodTarget target) {

    for (String s : shell.getSimpleParser().getEveryCommand()) {
      completions.add(new Completion(s));
    }
    return true;
  }
View Full Code Here

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

        completion += file.getName();

        completion = convertCompletionBackIntoUserInputStyle(originalUserInput, completion);

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

  }

  @Override
  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

TOP

Related Classes of org.springframework.shell.core.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.