Examples of TemplateVariable


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

      }
      if (buffer != null) {
        string = buffer.getString();
        TemplateVariable[] variables = buffer.getVariables();
        for (int i = 0; i != variables.length; i++) {
          TemplateVariable variable = variables[i];
          if ("cursor".equals(variable.getName())) {//$NON-NLS-1$
            offset = variable.getOffsets()[0];
          }
        }
      }
    }
    return new CompiledTemplate(string, offset);
View Full Code Here

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

      // translate positions
      LinkedModeModel model= new LinkedModeModel();
      TemplateVariable[] variables= templateBuffer.getVariables();
      boolean hasPositions= false;
      for (int i= 0; i != variables.length; i++) {
        TemplateVariable variable= variables[i];

        if (variable.isUnambiguous())
          continue;

        LinkedPositionGroup group= new LinkedPositionGroup();

        int[] offsets= variable.getOffsets();
        int length= variable.getLength();

        LinkedPosition first;
        {
          String[] values= variable.getValues();
          ICompletionProposal[] proposals= new ICompletionProposal[values.length];
          for (int j= 0; j < values.length; j++) {
            ensurePositionCategoryInstalled(document, model);
            Position pos= new Position(offsets[0] + start, length);
            document.addPosition(getCategory(), pos);
View Full Code Here

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

  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();
  }
View Full Code Here

Examples of org.springframework.hateoas.TemplateVariable

      return TemplateVariables.NONE;
    }

    String description = String.format("pagination.%s.description", sortParameter);
    VariableType type = append ? REQUEST_PARAM_CONTINUED : REQUEST_PARAM;
    return new TemplateVariables(new TemplateVariable(sortParameter, type, description));
  }
View Full Code Here

Examples of org.springframework.hateoas.TemplateVariable

      if (!queryParameters.containsKey(propertyName)) {

        VariableType type = append ? REQUEST_PARAM_CONTINUED : REQUEST_PARAM;
        String description = String.format("pagination.%s.description", propertyName);
        names.add(new TemplateVariable(propertyName, type, description));
      }
    }

    TemplateVariables pagingVariables = new TemplateVariables(names);
    return pagingVariables.concat(sortResolver.getSortTemplateVariables(parameter, template));
View Full Code Here

Examples of org.springframework.hateoas.TemplateVariable

      }

      TemplateVariables variables = new TemplateVariables();

      for (ParameterMetadata metadata : mapping.getParametersMetadata()) {
        variables = variables.concat(new TemplateVariable(metadata.getName(), VariableType.REQUEST_PARAM));
      }

      String href = builder.slash(mapping.getPath()).toString().concat(variables.toString());

      Link link = new Link(href, mapping.getRel());
View Full Code Here

Examples of org.springframework.hateoas.TemplateVariable

    }

    ProjectionDefinitionConfiguration projectionConfiguration = config.projectionConfiguration();

    if (projectionConfiguration.hasProjectionFor(type)) {
      variables = variables.concat(new TemplateVariable(projectionConfiguration.getParameterName(), REQUEST_PARAM));
    }

    return variables.asList().isEmpty() ? linkFor(type).withRel(metadata.getRel()) : new Link(new UriTemplate(href,
        variables), metadata.getRel());
  }
View Full Code Here

Examples of org.springframework.hateoas.TemplateVariable

    if (!projectionConfiguration.hasProjectionFor(type)) {
      return link;
    }

    String parameterName = projectionConfiguration.getParameterName();
    TemplateVariables templateVariables = new TemplateVariables(new TemplateVariable(parameterName, REQUEST_PARAM));
    UriTemplate template = new UriTemplate(link.getHref(), templateVariables);

    return new Link(template.toString(), metadata.getItemResourceRel());
  }
View Full Code Here

Examples of org.springframework.hateoas.TemplateVariable

    xdRuntime.add(entityLinks.linkFor(JobExecutionInfoResource.class).withRel("jobs/executions"));
    xdRuntime.add(entityLinks.linkFor(JobInstanceInfoResource.class).withRel("jobs/instances"));


    // Maybe https://github.com/spring-projects/spring-hateoas/issues/169 will help eventually
    TemplateVariable start = new TemplateVariable("start", VariableType.REQUEST_PARAM);
    TemplateVariable lod = new TemplateVariable("detailLevel", VariableType.REQUEST_PARAM_CONTINUED);
    TemplateVariables vars = new TemplateVariables(start, lod);
    for (CompletionKind k : CompletionKind.values()) {
      Object mi = ControllerLinkBuilder.methodOn(CompletionsController.class).completions(k, "", 42);
      Link link = ControllerLinkBuilder.linkTo(mi).withRel(String.format("completions/%s", k));
      String href = link.getHref().substring(0, link.getHref().lastIndexOf('?'));
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.