Examples of TemplateContextType


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

   *         given location, or <code>null</code>
   */
  private TemplateContext createContext(ITextViewer viewer, IRegion region, int offset) {
    // pretty much same code as super.createContext except create
    // SmartReplaceTemplateContext
    TemplateContextType contextType = getContextType(viewer, region);
    if (contextType != null) {
      IDocument document = viewer.getDocument();
      return new ReplaceNameTemplateContext(contextType, document, region.getOffset(), region.getLength(), offset);
    }
    return null;
View Full Code Here

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

  protected ICompletionProposal createProposal(Template template, TemplateContext context, IRegion region, int relevance) {
    return new CustomTemplateProposal(template, context, region, getImage(template), relevance);
  }

  protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
    TemplateContextType type = null;

    ContextTypeRegistry registry = getTemplateContextRegistry();
    if (registry != null)
      type = registry.getContextType(fContextTypeId);
View Full Code Here

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

  String getTemplateString() {
    String templateString = null;

    Template template = getSelectedTemplate();
    if (template != null) {
      TemplateContextType contextType = JSPUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsJSP.NEW);
      IDocument document = new Document();
      TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);
      try {
        TemplateBuffer buffer = context.evaluate(template);
        templateString = buffer.getString();
View Full Code Here

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

   *         given location, or <code>null</code>
   */
  private TemplateContext createContext(ITextViewer viewer, IRegion region, int offset) {
    // pretty much same code as super.createContext except create
    // SmartReplaceTemplateContext
    TemplateContextType contextType = getContextType(viewer, region);
    if (contextType != null) {
      IDocument document = viewer.getDocument();
      return new ReplaceNameTemplateContext(contextType, document, region.getOffset(), region.getLength(), offset);
    }
    return null;
View Full Code Here

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

  protected ICompletionProposal createProposal(Template template, TemplateContext context, IRegion region, int relevance) {
    return new CustomTemplateProposal(template, context, region, getImage(template), relevance);
  }

  protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
    TemplateContextType type = null;

    ContextTypeRegistry registry = getTemplateContextRegistry();
    if (registry != null)
      type = registry.getContextType(fContextTypeId);
View Full Code Here

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

  String getTemplateString() {
    String templateString = null;

    Template template = getSelectedTemplate();
    if (template != null) {
      TemplateContextType contextType = XMLUIPlugin.getDefault().getTemplateContextRegistry().getContextType(TemplateContextTypeIdsXML.NEW);
      IDocument document = new Document();
      TemplateContext context = new DocumentTemplateContext(contextType, document, 0, 0);
      try {
        TemplateBuffer buffer = context.evaluate(template);
        templateString = buffer.getString();
View Full Code Here

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

   *         given location, or <code>null</code>
   */
  private TemplateContext createContext(ITextViewer viewer, IRegion region, int offset) {
    // pretty much same code as super.createContext except create
    // SmartReplaceTemplateContext
    TemplateContextType contextType = getContextType(viewer, region);
    if (contextType != null) {
      IDocument document = viewer.getDocument();
      return new ReplaceNameTemplateContext(contextType, document, region.getOffset(), region.getLength(), offset);
    }
    return null;
View Full Code Here

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

  protected ICompletionProposal createProposal(Template template, TemplateContext context, IRegion region, int relevance) {
    return new CustomTemplateProposal(template, context, region, getImage(template), relevance);
  }

  protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
    TemplateContextType type = null;

    ContextTypeRegistry registry = getTemplateContextRegistry();
    if (registry != null) {
      type = registry.getContextType(fContextTypeId);
    }
View Full Code Here

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

    }


    protected TemplateContextType getContextType( ITextViewer viewer, IRegion region )
    {
        TemplateContextType contextType = BrowserCommonActivator.getDefault().getFilterTemplateContextTypeRegistry()
            .getContextType( BrowserCommonConstants.FILTER_TEMPLATE_ID );
        return contextType;
    }
View Full Code Here

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

    /**
     * @see org.eclipse.jface.text.templates.TemplateCompletionProcessor#getContextType(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
     */
    protected TemplateContextType getContextType( ITextViewer viewer, IRegion region )
    {
        TemplateContextType contextType = BrowserCommonActivator.getDefault().getFilterTemplateContextTypeRegistry()
            .getContextType( BrowserCommonConstants.FILTER_TEMPLATE_ID );
        return contextType;
    }
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.