Examples of TemplateProposal


Examples of com.google.collide.client.code.autocomplete.codegraph.TemplateProposal

    }
    return instance;
  }

  private static void addProposal(AbstractTrie<TemplateProposal> to, String name, String template) {
    to.put(name, new TemplateProposal(name, template));
  }
View Full Code Here

Examples of com.google.collide.client.code.autocomplete.codegraph.TemplateProposal

  }

  private final PrefixIndex<TemplateProposal> proposalTemplateTrie;

  private static void addProposal(AbstractTrie<TemplateProposal> to, String name, String template) {
    to.put(name, new TemplateProposal(name, template));
  }
View Full Code Here

Examples of com.google.collide.client.code.autocomplete.codegraph.TemplateProposal

    }
    return instance;
  }

  private static void addProposal(AbstractTrie<TemplateProposal> to, String name, String template) {
    to.put(name, new TemplateProposal(name, template));
  }
View Full Code Here

Examples of org.eclipse.jdt.internal.ui.text.template.contentassist.TemplateProposal

            // sort them first
            IJavaCompletionProposal[] keyWordResults= collector.getKeywordCompletionProposals();
            for (int i= 0; i < keyWordResults.length; i++) {
                String keyword= keyWordResults[i].getDisplayString();
                for (int k= 0; k < templateResults.length; k++) {
                    TemplateProposal curr= templateResults[k];
                    if (curr.getTemplate().getName().startsWith(keyword)) {
                        curr.setRelevance(keyWordResults[i].getRelevance() + 1);
                    }
                }
            }

            // concatenate arrays
View Full Code Here

Examples of org.eclipse.jface.text.templates.TemplateProposal

      ICompletionProposal[] result = merge(templates, proposals);

      List<ICompletionProposal> prop = new ArrayList<ICompletionProposal>();
      if (result != null) {
        for (int i = 0; i < result.length; i++) {
          TemplateProposal tprop = (TemplateProposal) result[i];
          if ((tprop.getRelevance() > 0) && (!prop.contains(tprop)))
            prop.add(tprop);
        }
        result = prop.toArray(new TemplateProposal[prop.size()]);
      }
      return result;
View Full Code Here

Examples of org.eclipse.jface.text.templates.TemplateProposal

  private List<TemplateProposal> createQVTProposals(List<Object> objects,
      IRegion region) {
    List<TemplateProposal> proposals = new ArrayList<TemplateProposal>();
    for (Iterator<Object> iter = objects.iterator(); iter.hasNext();) {
      TemplateProposal temp = createTemplateProposal(iter.next(), region);
      if (temp != null)
        proposals.add(temp);
    }
    return proposals;
  }
View Full Code Here

Examples of org.eclipse.jface.text.templates.TemplateProposal

      if (description == null)
        description = "";

      Template template = new Template(name, description,
          QVTContextType.QVT_CONTEXT_TYPE, pattern, true);
      TemplateProposal proposal = new TemplateProposal(template, context,
          region, image_id, getRelevance(template, prefix));
      return proposal;
    } catch (Exception e) {
      UiPlugin.getDefault().getLogger().log(
          java.util.logging.Level.WARNING, "Unknown error", e);
View Full Code Here

Examples of org.eclipse.jface.text.templates.TemplateProposal

    String pattern = "helper ${type_in}::" + prefix
        + "(${}) : ${type_out}{\n"
        + "\t-- Auto-generated method stub\n\t${cursor}\n}";
    Template template = new Template(prefix, "Method Stub",
        QVTContextType.QVT_CONTEXT_TYPE, pattern, false);
    TemplateProposal proposal = new TemplateProposal(template, context,
        region, image_id, getRelevance(template, prefix));
    return proposal;
  }
View Full Code Here

Examples of org.eclipse.jface.text.templates.TemplateProposal

        IRegion region = ps.getRegion();
        TemplateContext context = createContext(edit.getPySourceViewer(), region, ps.getDoc());

        Template t = new Template("Convert", "% to .format()", "", replacementString, false);
        l.add(new TemplateProposal(t, context, region, imageCache.get(UIConstants.COMPLETION_TEMPLATE), 5));
        return l;
    }
View Full Code Here

Examples of org.eclipse.jface.text.templates.TemplateProposal

    private ICompletionProposal createProposal(PySelection ps, ImageCache imageCache, PyEdit edit,
            final String startIndent, IRegion region, int iComp, String comp, TemplateContext context) {
        Template t = new Template("Surround with", SURROUND_WITH_COMPLETIONS[iComp + 1], "", comp, false);
        if (context != null) {
            TemplateProposal proposal = new TemplateProposal(t, context, region,
                    imageCache.get(UIConstants.COMPLETION_TEMPLATE), 5) {
                @Override
                public String getAdditionalProposalInfo() {
                    return startIndent + super.getAdditionalProposalInfo();
                }
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.