Пример #1
0
  /* (non-Javadoc)
   * @see org.eclipse.jface.text.templates.TemplateVariableResolver#resolve(org.eclipse.jface.text.templates.TemplateVariable, org.eclipse.jface.text.templates.TemplateContext)
   */
  @Override
  public void resolve(TemplateVariable variable, TemplateContext context) {
    variable.setUnambiguous(true);
    variable.setValue(""); // $NON-NLS-1$

    if (context instanceof JavaContext) {
      JavaContext jc = (JavaContext) context;
      List<String> params = variable.getVariableType().getParams();
      if (params.size() > 0) {
        for (Iterator<String> iterator = params.iterator(); iterator.hasNext(); ) {
          String typeName = iterator.next();
          jc.addImport(typeName);
        }
      }
    } else {
      super.resolve(variable, context);
    }
  }
 @Override
 public void resolve(final TemplateVariable variable, final TemplateContext context) {
   variable.setValue(""); // $NON-NLS-1$
   variable.setUnambiguous(true);
 }