Examples of Completion


Examples of edu.bellevue.its.migration.entities.Completion

                }else
                {
                    Set<Completion> completions = requests.get(rowIndex).getCompletions();
                    Iterator<Completion> iter = completions.iterator();
                    Date newestDate = null;
                    Completion latestCompletion = null;
                    while (iter.hasNext())
                    {
                        Completion curComp = iter.next();
                        Date curDate = iter.next().getDateCompleted();
                        if (newestDate == null || curDate.after(newestDate))
                        {
                            newestDate = curDate;
                            latestCompletion = curComp;
View Full Code Here

Examples of juzu.impl.common.Completion

  public MockApplication<P> init() throws Exception {
    if (lifeCycle == null) {
      assertCompile();
    }
    if (lifeCycle != null) {
      Completion refresh = lifeCycle.refresh();
      if (refresh.isFailed()) {
        throw refresh.getCause();
      } else {
        return this;
      }
    } else {
      throw new IllegalStateException("Could not compile application");
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.session.parser.kernel.Completion

    public Completion getCompletion(int position)
    {
        if(super.getCompletion(position) != null) {
            Iterator<Completion> it = children.iterator();
            while(it.hasNext()) {
                Completion comp = it.next();
                if((comp = comp.getCompletion(position)) != null)
                    return comp;
            }
            SQLColumn col = new SQLColumn(this, position);
            col.setRepeatable(false);
            return col;
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.session.parser.kernel.Completion

        updateListEnd = position;
    }

    public Completion getCompletion(int position)
    {
        Completion c = super.getCompletion(position);
        if(c == null) {
            if(position >= updateListStart && position <= updateListEnd) {
                SQLColumn col = new SQLColumn(this, position);
                col.setRepeatable(false);
                return col;
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.session.parser.kernel.Completion

        return table != null ? table : sqlSchema.getTableForAlias(alias);
    }

    public Completion getCompletion(int offset)
    {
        Completion comp = super.getCompletion(offset);
        if(comp != null) return comp;

        if(offset >= selectListStart && offset <= selectListEnd)
            return new SQLColumn(this, offset, offset);
        else if(offset >= fromStart && offset <= fromEnd)
View Full Code Here

Examples of net.sourceforge.squirrel_sql.client.session.parser.kernel.Completion

    public Completion getCompletion(int position)
    {
        if(isEnclosed(position)) {
            Iterator<Completion> it = getChildren();
            while(it.hasNext()) {
                Completion c = it.next().getCompletion(position);
                if(c != null) return c;
            }
        }
        return null;
    }
View Full Code Here

Examples of nexj.core.meta.workflow.Completion

      {
         Activity activity = fork.getConcurrent(0);

         if (activity.getStep(0) instanceof Timeout)
         {
            activity.addStep(new Completion(assignment));
         }

         if (decision.getBranchCount() > 1)
         {
            for (int i = 0; i != activity.getStepCount(); ++i)
View Full Code Here

Examples of org.apache.karaf.shell.api.action.Completion

            Completer completer = null;
            Field field = arguments.get(key);
            if (field != null) {
                Argument argument = field.getAnnotation(Argument.class);
                multi = (argument != null && argument.multiValued());
                Completion ann = field.getAnnotation(Completion.class);
                if (ann != null) {
                    Class<?> clazz = ann.value();
                    String[] value = ann.values();
                    if (clazz != null) {
                        if (value.length > 0 && clazz == StringsCompleter.class) {
                            completer = new StringsCompleter(value, ann.caseSensitive());
                        } else {
                            completer = command.getCompleter(clazz);
                        }
                    }
                } else {
                    completer = getDefaultCompleter(field, multi);
                }
            }
            if (completer == null) {
                completer = NullCompleter.INSTANCE;
            }
            argsCompleters.add(completer);
        }
        if (argsCompleters.isEmpty() || !multi) {
            argsCompleters.add(NullCompleter.INSTANCE);
        }
        optionalCompleters = new HashMap<>();
        for (Option option : fields.keySet()) {
            Completer completer = null;
            Field field = fields.get(option);
            if (field != null) {
                Completion ann = field.getAnnotation(Completion.class);
                if (ann != null) {
                    Class clazz = ann.value();
                    String[] value = ann.values();
                    if (clazz != null) {
                        if (clazz == StringsCompleter.class) {
                            completer = new StringsCompleter(value, ann.caseSensitive());
                        } else {
                            completer = command.getCompleter(clazz);
                        }
                    }
                } else {
View Full Code Here

Examples of org.crsh.cli.spi.Completion

              log.fine("No process can handle the key event");
            }
          } else if (type.getAsString().equals("complete")) {
            String prefix = event.get("prefix").getAsString();
            CompletionMatch completion = session.shell.complete(prefix);
            Completion completions = completion.getValue();
            Delimiter delimiter = completion.getDelimiter();
            StringBuilder sb = new StringBuilder();
            List<String> values = new ArrayList<String>();
            try {
              if (completions.getSize() == 1) {
                String value = completions.getValues().iterator().next();
                delimiter.escape(value, sb);
                if (completions.get(value)) {
                  sb.append(delimiter.getValue());
                }
                values.add(sb.toString());
              }
              else {
                String commonCompletion = Utils.findLongestCommonPrefix(completions.getValues());
                if (commonCompletion.length() > 0) {
                  delimiter.escape(commonCompletion, sb);
                  values.add(sb.toString());
                }
                else {
View Full Code Here

Examples of org.crsh.cli.spi.Completion

  }

  private void complete(CharSequence prefix) {
    log.log(Level.FINE, "About to get completions for " + prefix);
    CompletionMatch completion = shell.complete(prefix.toString());
    Completion completions = completion.getValue();
    log.log(Level.FINE, "Completions for " + prefix + " are " + completions);

    //
    Delimiter delimiter = completion.getDelimiter();

    try {
      // Try to find the greatest prefix among all the results
      if (completions.getSize() == 0) {
        // Do nothing
      } else if (completions.getSize() == 1) {
        Map.Entry<String, Boolean> entry = completions.iterator().next();
        Appendable buffer = term.getDirectBuffer();
        String insert = entry.getKey();
        term.getDirectBuffer().append(delimiter.escape(insert));
        if (entry.getValue()) {
          buffer.append(completion.getDelimiter().getValue());
        }
      } else {
        String commonCompletion = Utils.findLongestCommonPrefix(completions.getValues());

        // Format stuff
        int width = term.getWidth();

        //
        String completionPrefix = completions.getPrefix();

        // Get the max length
        int max = 0;
        for (String suffix : completions.getValues()) {
          max = Math.max(max, completionPrefix.length() + suffix.length());
        }

        // Separator : use two whitespace like in BASH
        max += 2;

        //
        StringBuilder sb = new StringBuilder().append('\n');
        if (max < width) {
          int columns = width / max;
          int index = 0;
          for (String suffix : completions.getValues()) {
            sb.append(completionPrefix).append(suffix);
            for (int l = completionPrefix.length() + suffix.length();l < max;l++) {
              sb.append(' ');
            }
            if (++index >= columns) {
              index = 0;
              sb.append('\n');
            }
          }
          if (index > 0) {
            sb.append('\n');
          }
        } else {
          for (Iterator<String> i = completions.getValues().iterator();i.hasNext();) {
            String suffix = i.next();
            sb.append(commonCompletion).append(suffix);
            if (i.hasNext()) {
              sb.append('\n');
            }
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.