Examples of DocumentTemplateContext


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

  private static DocumentTemplateContext getContext(
      ContextTypeRegistry contextTypeRegistry, Template template,
      String containerName, String fileName, IDocument document, CodeTemplateVariableHolder varHolder) {

    if (fileName == null) {
      return new DocumentTemplateContext(contextTypeRegistry
          .getContextType(template.getContextTypeId()), document, 0,
          0);

    }
View Full Code Here

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

   * @since 3.1
   */
  protected final int getReplaceOffset() {
    int start;
    if (fContext instanceof DocumentTemplateContext) {
      DocumentTemplateContext docContext = (DocumentTemplateContext)fContext;
      start= docContext.getStart();
    } else {
      start= fRegion.getOffset();
    }
    return start;
  }
View Full Code Here

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

   * @since 3.1
   */
  protected final int getReplaceEndOffset() {
    int end;
    if (fContext instanceof DocumentTemplateContext) {
      DocumentTemplateContext docContext = (DocumentTemplateContext)fContext;
      end= docContext.getEnd();
    } else {
      end= fRegion.getOffset() + fRegion.getLength();
    }
    return end;
  }
View Full Code Here

Examples of org.epic.perleditor.templates.DocumentTemplateContext

        Point selection = viewer.getSelectedRange();
        ((CompilationUnitContextType) contextType).setContextParameters(
            document, completionPosition, selection.y);

        DocumentTemplateContext context =
            (DocumentTemplateContext) contextType.createContext();

        int start = context.getStart();
        int end = context.getEnd();
        IRegion region = new Region(start, end - start);

        Template[] templates = Templates.getInstance().getTemplates();
        for (int i = 0; i != templates.length; i++)
        {
            if (context.canEvaluate(templates[i]))
            {
                proposals.add(new TemplateProposal(
                    templates[i],
                    context,
                    region,
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.