Java 类org.eclipse.jface.text.templates.GlobalTemplateVariables 实例源码

项目:che    文件:JavaDocContextType.java   
/** Creates a java context type. */
public JavaDocContextType() {

  // global
  addResolver(new GlobalTemplateVariables.Cursor());
  addResolver(new SurroundWithLineSelection());
  addResolver(new SurroundWithWordSelection());
  addResolver(new GlobalTemplateVariables.Dollar());
  addResolver(new GlobalTemplateVariables.Date());
  addResolver(new GlobalTemplateVariables.Year());
  addResolver(new GlobalTemplateVariables.Time());
  addResolver(new GlobalTemplateVariables.User());

  // compilation unit
  addResolver(new File());
  addResolver(new PrimaryTypeName());
  addResolver(new Method());
  addResolver(new ReturnType());
  addResolver(new Arguments());
  addResolver(new Type());
  addResolver(new Package());
  addResolver(new Project());
}
项目:brainfuck    文件:BfTemplateType.java   
private void addResolvers(int noOfParameters) {
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());

    addResolver(new EvalResolver("eval", "Evaluates an expression. Returns empty String, used to define intermediate variables used as parameters"));
    addResolver(new BfMemShiftResolver("mem_shift", "Inserts (number) of memory pointer shifts. Negative parameter shifts left, positive shifts right"));
    addResolver(new BfIncDecResolver("inc_dec", "Inserts (number) of increments/decrements. Negative parameter decrements, positive increments"));
    addResolver(new BfKeyResolver("trigger_key", "Evaluates to the text on which the template proposal was triggered"));
    addResolver(new PatternGenerator("repeat", ":repeat(ex1, pattern, ex2) repeats the pattern ex1 times and deletes ex2 characters from the result"));

    for (int i = noOfParameters; i>0; i--) {
        addResolver(new BfNamedParameterResolver(i));
    }
}
项目:APICloud-Studio    文件:SnippetTemplateContextType.java   
private void addGlobalResolvers()
{

    // Global
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());

    // Tabstops resolver
    addResolver(new TabStopVariableResolver());
    // Environment variables resolver
    addResolver(new EnvironmentVariableVariableResolver());
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaDocContextType.java   
/**
 * Creates a java context type.
 */
public JavaDocContextType() {

    // global
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new SurroundWithLineSelection());
    addResolver(new SurroundWithWordSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());

    // compilation unit
    addResolver(new File());
    addResolver(new PrimaryTypeName());
    addResolver(new Method());
    addResolver(new ReturnType());
    addResolver(new Arguments());
    addResolver(new Type());
    addResolver(new Package());
    addResolver(new Project());
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaDocContextType.java   
/**
 * Creates a java context type.
 */
public JavaDocContextType() {

    // global
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new SurroundWithLineSelection());
    addResolver(new SurroundWithWordSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());

    // compilation unit
    addResolver(new File());
    addResolver(new PrimaryTypeName());
    addResolver(new Method());
    addResolver(new ReturnType());
    addResolver(new Arguments());
    addResolver(new Type());
    addResolver(new Package());
    addResolver(new Project());
}
项目:Pydev    文件:PyContextType.java   
private void addGlobalResolvers() {
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());

    PyContextTypeVariables.addResolvers(this);
    HashMap<String, Object> locals = new HashMap<String, Object>();
    locals.put("py_context_type", this);

    //execute all the files that start with 'pytemplate' that are located beneath
    //the org.python.pydev.jython/jysrc directory and some user specified dir (if any).
    JythonPlugin.execAll(locals, "pytemplate", interpreter);

}
项目:ftc    文件:TweakedTemplateProposal.java   
private int getCaretOffset(TemplateBuffer buffer) {

        TemplateVariable[] variables = buffer.getVariables();
        for (int i = 0; i != variables.length; i++) {
            TemplateVariable variable = variables[i];
            if (variable.getType().equals(GlobalTemplateVariables.Cursor.NAME))
                return variable.getOffsets()[0];
        }

        return buffer.getString().length();
    }
项目:texlipse    文件:BibTexContextType.java   
private void addGlobalResolvers() {
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());
}
项目:texlipse    文件:TexContextType.java   
private void addGlobalResolvers() {
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());
}
项目:fluentmark    文件:SourceTemplateContextType.java   
private void addGlobalResolvers() {
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());
}
项目:typescript.java    文件:AbstractTypeScriptContextType.java   
public AbstractTypeScriptContextType(String name) {
    super(name);

    // global
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());

}
项目:bts    文件:XtextTemplateContextType.java   
protected void addDefaultTemplateVariables() {
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.User());
    addResolver(new GlobalTemplateVariables.Cursor());
}
项目:che    文件:CompilationUnitContextType.java   
@Override
protected String resolve(TemplateContext context) {
  String selection =
      context.getVariable(org.eclipse.jface.text.templates.GlobalTemplateVariables.SELECTION);
  if (selection == null) return ""; // $NON-NLS-1$
  return selection;
}
项目:che    文件:CompilationUnitContextType.java   
@Override
protected void validateVariables(TemplateVariable[] variables) throws TemplateException {
  // check for multiple cursor variables
  for (int i = 0; i < variables.length; i++) {
    TemplateVariable var = variables[i];
    if (var.getType().equals(GlobalTemplateVariables.Cursor.NAME)) {
      if (var.getOffsets().length > 1) {
        throw new TemplateException(
            JavaTemplateMessages.ContextType_error_multiple_cursor_variables);
      }
    }
  }
}
项目:che    文件:JavaDocContextType.java   
@Override
protected String resolve(TemplateContext context) {
  String selection =
      context.getVariable(org.eclipse.jface.text.templates.GlobalTemplateVariables.SELECTION);
  if (selection == null) return ""; // $NON-NLS-1$
  return selection;
}
项目:che    文件:AbstractJavaContextType.java   
/**
 * Initializes the context type resolvers.
 *
 * <p><strong>Note:</strong> Only call this method if this context type doesn't inherit from
 * another context type which already has these resolvers.
 *
 * @since 3.4
 */
public void initializeContextTypeResolvers() {

  // global
  addResolver(new GlobalTemplateVariables.Cursor());
  addResolver(new GlobalTemplateVariables.WordSelection());
  addResolver(new SurroundWithLineSelection());
  addResolver(new GlobalTemplateVariables.Dollar());
  addResolver(new GlobalTemplateVariables.Date());
  addResolver(new GlobalTemplateVariables.Year());
  addResolver(new GlobalTemplateVariables.Time());
  addResolver(new GlobalTemplateVariables.User());

  // compilation unit
  addResolver(new File());
  addResolver(new PrimaryTypeName());
  addResolver(new ReturnType());
  addResolver(new Method());
  addResolver(new Type());
  addResolver(new Package());
  addResolver(new Project());
  addResolver(new Arguments());

  // java
  addResolver(new Array());
  addResolver(new ArrayType());
  addResolver(new ArrayElement());
  addResolver(new Index());
  addResolver(new Iterator());
  addResolver(new Collection());
  addResolver(new Iterable());
  addResolver(new IterableType());
  addResolver(new IterableElement());
  addResolver(new Todo());
}
项目:che    文件:TemplateProposal.java   
private int getCaretOffset(TemplateBuffer buffer) {

    TemplateVariable[] variables = buffer.getVariables();
    for (int i = 0; i != variables.length; i++) {
      TemplateVariable variable = variables[i];
      if (variable.getType().equals(GlobalTemplateVariables.Cursor.NAME))
        return variable.getOffsets()[0];
    }

    return buffer.getString().length();
  }
项目:velocity-edit    文件:VeloContextType.java   
private void addGlobalResolvers()
{
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());

    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());
}
项目:KaiZen-OpenAPI-Editor    文件:SwaggerContextType.java   
private void addGlobalResolvers() {
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());
}
项目:KaiZen-OpenAPI-Editor    文件:SchemaBasedTemplateContextType.java   
private void addGlobalResolvers() {
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());
    addResolver(new ElementNameResolver());
}
项目:APICloud-Studio    文件:SnippetTemplateProposal.java   
private int getCaretOffset(TemplateBuffer buffer)
{

    TemplateVariable[] variables = buffer.getVariables();
    for (int i = 0; i != variables.length; i++)
    {
        TemplateVariable variable = variables[i];
        if (variable.getType().equals(GlobalTemplateVariables.Cursor.NAME))
            return variable.getOffsets()[0];
    }

    return buffer.getString().length();
}
项目:Eclipse-Postfix-Code-Completion    文件:CompilationUnitContextType.java   
@Override
protected String resolve(TemplateContext context) {
    String selection= context.getVariable(org.eclipse.jface.text.templates.GlobalTemplateVariables.SELECTION);
    if (selection == null)
        return ""; //$NON-NLS-1$
    return selection;
}
项目:Eclipse-Postfix-Code-Completion    文件:CompilationUnitContextType.java   
@Override
protected void validateVariables(TemplateVariable[] variables) throws TemplateException {
    // check for multiple cursor variables
    for (int i= 0; i < variables.length; i++) {
        TemplateVariable var= variables[i];
        if (var.getType().equals(GlobalTemplateVariables.Cursor.NAME)) {
            if (var.getOffsets().length > 1) {
                throw new TemplateException(JavaTemplateMessages.ContextType_error_multiple_cursor_variables);
            }
        }
    }
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaDocContextType.java   
@Override
protected String resolve(TemplateContext context) {
    String selection= context.getVariable(org.eclipse.jface.text.templates.GlobalTemplateVariables.SELECTION);
    if (selection == null)
        return ""; //$NON-NLS-1$
    return selection;
}
项目:Eclipse-Postfix-Code-Completion    文件:AbstractJavaContextType.java   
/**
 * Initializes the context type resolvers.
 * <p>
 * <strong>Note:</strong> Only call this method if this
 * context type doesn't inherit from another context type
 * which already has these resolvers.</p>
 *
 * @since 3.4
 */
public void initializeContextTypeResolvers() {

    // global
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new SurroundWithLineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());

    // compilation unit
    addResolver(new File());
    addResolver(new PrimaryTypeName());
    addResolver(new ReturnType());
    addResolver(new Method());
    addResolver(new Type());
    addResolver(new Package());
    addResolver(new Project());
    addResolver(new Arguments());

    // java
    addResolver(new Array());
    addResolver(new ArrayType());
    addResolver(new ArrayElement());
    addResolver(new Index());
    addResolver(new Iterator());
    addResolver(new Collection());
    addResolver(new Iterable());
    addResolver(new IterableType());
    addResolver(new IterableElement());
    addResolver(new Todo());
}
项目:Eclipse-Postfix-Code-Completion    文件:TemplateProposal.java   
private int getCaretOffset(TemplateBuffer buffer) {

        TemplateVariable[] variables= buffer.getVariables();
        for (int i= 0; i != variables.length; i++) {
            TemplateVariable variable= variables[i];
            if (variable.getType().equals(GlobalTemplateVariables.Cursor.NAME))
                return variable.getOffsets()[0];
        }

        return buffer.getString().length();
    }
项目:idecore    文件:ForceTemplateContextType.java   
private void addGlobalResolvers() {
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());
}
项目:idecore    文件:ForceTemplateContextType.java   
@Override
protected void validateVariables(TemplateVariable[] variables) throws TemplateException {
    // check for multiple cursor variables
    for (int i = 0; i < variables.length; i++) {
        TemplateVariable var = variables[i];
        if (var.getType().equals(GlobalTemplateVariables.Cursor.NAME)) {
            if (var.getOffsets().length > 1) {
                throw new TemplateException("Template has multiple cursor variables.");
            }
        }
    }
}
项目:idecore    文件:ApexTemplateContextType.java   
private void addGlobalResolvers() {
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());
}
项目:idecore    文件:ApexTemplateContextType.java   
@Override
protected void validateVariables(TemplateVariable[] variables) throws TemplateException {
    // check for multiple cursor variables
    for (int i = 0; i < variables.length; i++) {
        TemplateVariable var = variables[i];
        if (var.getType().equals(GlobalTemplateVariables.Cursor.NAME)) {
            if (var.getOffsets().length > 1) {
                throw new TemplateException("Template has multiple cursor variables.");
            }
        }
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CompilationUnitContextType.java   
@Override
protected String resolve(TemplateContext context) {
    String selection= context.getVariable(org.eclipse.jface.text.templates.GlobalTemplateVariables.SELECTION);
    if (selection == null)
        return ""; //$NON-NLS-1$
    return selection;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:CompilationUnitContextType.java   
@Override
protected void validateVariables(TemplateVariable[] variables) throws TemplateException {
    // check for multiple cursor variables
    for (int i= 0; i < variables.length; i++) {
        TemplateVariable var= variables[i];
        if (var.getType().equals(GlobalTemplateVariables.Cursor.NAME)) {
            if (var.getOffsets().length > 1) {
                throw new TemplateException(JavaTemplateMessages.ContextType_error_multiple_cursor_variables);
            }
        }
    }
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaDocContextType.java   
@Override
protected String resolve(TemplateContext context) {
    String selection= context.getVariable(org.eclipse.jface.text.templates.GlobalTemplateVariables.SELECTION);
    if (selection == null)
        return ""; //$NON-NLS-1$
    return selection;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:AbstractJavaContextType.java   
/**
 * Initializes the context type resolvers.
 * <p>
 * <strong>Note:</strong> Only call this method if this
 * context type doesn't inherit from another context type
 * which already has these resolvers.</p>
 *
 * @since 3.4
 */
public void initializeContextTypeResolvers() {

    // global
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new SurroundWithLineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());

    // compilation unit
    addResolver(new File());
    addResolver(new PrimaryTypeName());
    addResolver(new ReturnType());
    addResolver(new Method());
    addResolver(new Type());
    addResolver(new Package());
    addResolver(new Project());
    addResolver(new Arguments());

    // java
    addResolver(new Array());
    addResolver(new ArrayType());
    addResolver(new ArrayElement());
    addResolver(new Index());
    addResolver(new Iterator());
    addResolver(new Collection());
    addResolver(new Iterable());
    addResolver(new IterableType());
    addResolver(new IterableElement());
    addResolver(new Todo());
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:TemplateProposal.java   
private int getCaretOffset(TemplateBuffer buffer) {

        TemplateVariable[] variables= buffer.getVariables();
        for (int i= 0; i != variables.length; i++) {
            TemplateVariable variable= variables[i];
            if (variable.getType().equals(GlobalTemplateVariables.Cursor.NAME))
                return variable.getOffsets()[0];
        }

        return buffer.getString().length();
    }
项目:goclipse    文件:CompilationUnitContextType.java   
@Override
protected String resolve(TemplateContext context) {
    String selection= context.getVariable(GlobalTemplateVariables.SELECTION);
    if (selection == null)
        return "";
    return selection;
}
项目:goclipse    文件:LangTemplateContextType.java   
protected void setupResolvers() {
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
    addResolver(new GlobalTemplateVariables.Dollar());
    addResolver(new GlobalTemplateVariables.Date());
    addResolver(new GlobalTemplateVariables.Year());
    addResolver(new GlobalTemplateVariables.Time());
    addResolver(new GlobalTemplateVariables.User());

    addAdditionalResolvers();
}
项目:goclipse    文件:LangTemplateContextType.java   
@Override
protected void validateVariables(TemplateVariable[] variables) throws TemplateException {
    // check for multiple cursor variables
    for(int i = 0; i < variables.length; i++) {
        TemplateVariable var = variables[i];
        if(var.getType().equals(GlobalTemplateVariables.Cursor.NAME)) {
            if(var.getOffsets().length > 1) {
                throw new TemplateException(JavaTemplateMessages.ContextType_error_multiple_cursor_variables);
            }
        }
    }
}
项目:pgcodekeeper    文件:SQLEditorTemplateContextType.java   
public SQLEditorTemplateContextType() {
    addResolver(new GlobalTemplateVariables.Cursor());
    addResolver(new GlobalTemplateVariables.WordSelection());
    addResolver(new GlobalTemplateVariables.LineSelection());
}
项目:ftc    文件:FtcContextType.java   
private void addGlobalResolvers() {
    addResolver(new GlobalTemplateVariables.Cursor());
}