Package org.eclipse.jface.text.templates

Examples of org.eclipse.jface.text.templates.Template.matches()


        context.getContextType().validate(template.getPattern());
      } catch (TemplateException e) {
        continue;
      }
      if (template.getName().startsWith(prefix) &&
          template.matches(prefix, context.getContextType().getId()))
        matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
    }

    return (ICompletionProposal[]) matches.toArray(new ICompletionProposal[matches.size()]);
  }
View Full Code Here


        continue;
      }
      if(!prefix.equals("") &&prefix.charAt(0)=='<')
        prefix = prefix.substring(1);
      if (!prefix.equals("")&&(template.getName().startsWith(prefix) &&
          template.matches(prefix, context.getContextType().getId())))
        matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
    }
    return matches.toArray(new ICompletionProposal[matches.size()]);
  }
  protected boolean isLastCharDot(IDocument doc, int offset){
View Full Code Here

        continue;
      }
      if(!prefix.equals("") &&prefix.charAt(0)=='<')
        prefix = prefix.substring(1);
      if (!prefix.equals("")&&(template.getName().startsWith(prefix) &&
          template.matches(prefix, context.getContextType().getId())))
        matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
    }
    return matches.toArray(new ICompletionProposal[matches.size()]);
  }
  protected boolean isLastCharDot(IDocument doc, int offset){
View Full Code Here

        context.getContextType().validate(template.getPattern());
      }
      catch (TemplateException e) {
        continue;
      }
      if (template.matches(prefix, context.getContextType().getId()))
        matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
    }

    Collections.sort(matches, fgProposalComparator);
View Full Code Here

        context.getContextType().validate(template.getPattern());
      }
      catch (TemplateException e) {
        continue;
      }
      if (template.matches(prefix, context.getContextType().getId()))
        matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
    }

    Collections.sort(matches, fgProposalComparator);
View Full Code Here

        context.getContextType().validate(template.getPattern());
      }
      catch (TemplateException e) {
        continue;
      }
      if (template.matches(prefix, context.getContextType().getId())) {
        int place = getRelevance(template, prefix);
        matches.add(createProposal(template, context, (IRegion) region, place));
      }
    }
View Full Code Here

          contextType.validate(template.getPattern());
        } catch (TemplateException e) {
          continue;
        }     
       
        if (template.matches(prefix, contextType.getId()) && template.getName().startsWith(prefix)){
          String indent = doc.getIndentString(offset);
          template = new TemplateWithIndent(template, indent);
          HdlTemplateProposal hdlTemplateProposal=new HdlTemplateProposal(template,
                                documnetTemplateContext,
                                region,
View Full Code Here

        context.getContextType().validate(template.getPattern());
      } catch (TemplateException e) {
        continue;
      }
      if (template.getName().startsWith(prefix) &&
          template.matches(prefix, context.getContextType().getId()))
        matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
    }

    return matches.toArray(new ICompletionProposal[matches.size()]);
  }
View Full Code Here

                continue;
            }

            if (prefixLowerCase.length() == 0) {
                // original code: doesn't use prefix
                if (template.matches(prefixLowerCase, context.getContextType().getId())) {
                    matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
                }
            } else {
                // as per http://dev.eclipse.org/newslists/news.eclipse.platform/msg26165.html
                if (template.matches(prefix, context.getContextType().getId()) &&
View Full Code Here

                if (template.matches(prefixLowerCase, context.getContextType().getId())) {
                    matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
                }
            } else {
                // as per http://dev.eclipse.org/newslists/news.eclipse.platform/msg26165.html
                if (template.matches(prefix, context.getContextType().getId()) &&
                    template.getName().toLowerCase().startsWith(prefixLowerCase)) {
                    matches.add(createProposal(template, context, (IRegion)region,getRelevance(template, prefixLowerCase)));
                }           
            }
        }
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.