Package com.google.eclipse.protobuf.protobuf

Examples of com.google.eclipse.protobuf.protobuf.IndexedElement


  @Fix(INVALID_FIELD_TAG_NUMBER_ERROR)
  public void regenerateTagNumber(Issue issue, IssueResolutionAcceptor acceptor) {
    ISemanticModification modification = new ISemanticModification() {
      @Override public void apply(EObject element, IModificationContext context) throws Exception {
        IndexedElement e = (IndexedElement) element;
        long tagNumber = indexedElements.calculateNewIndexFor(e);
        indexedElements.setIndexTo(e, tagNumber);
      }
    };
    acceptor.accept(issue, regenerateTagNumberLabel, regenerateTagNumberDescription, "field.gif", modification);
View Full Code Here


  Collection<IEObjectDescription> findOptionFields(AbstractCustomOption customOption, FinderStrategy strategy,
      OptionField field) {
    // TODO(alruiz): remove Provider of IndexedElement.
    final AbstractOption option = (AbstractOption) customOption;
    IndexedElement e = referredField(customOption, field, new Provider<IndexedElement>() {
      @Override public IndexedElement get() {
        return options.rootSourceOf(option);
      }
    });
    if (e != null) {
View Full Code Here

   * @param option the given custom option.
   * @return the {@code IndexedElement} the given custom option is referring to, or {@code null} if it cannot be
   * found.
   */
  public IndexedElement sourceOf(AbstractCustomOption option) {
    IndexedElement e = sourceOfLastFieldIn(option);
    if (e == null) {
      e = rootSourceOf((AbstractOption) option);
    }
    return e;
  }
View Full Code Here

   * Returns the name of the given option.
   * @param option the given option.
   * @return the name of the given option.
   */
  public String nameOf(FieldOption option) {
    IndexedElement e = rootSourceOf(option);
    if (e instanceof MessageField) {
      return ((MessageField) e).getName();
    }
    return null;
  }
View Full Code Here

    }
    return null;
  }

  private Object labelFor(AbstractOption option) {
    IndexedElement e = options.rootSourceOf(option);
    String name = options.nameForOption(e);
    if (option instanceof AbstractCustomOption) {
      AbstractCustomOption customOption = (AbstractCustomOption) option;
      StringBuilder b = new StringBuilder();
      b.append(formatCustomOptionElement(name));
      for (OptionField field : options.fieldsOf(customOption)) {
        IndexedElement source = field.getTarget();
        String sourceName = options.nameForOption(source);
        b.append(".")
         .append(formatCustomOptionElement(sourceName));
      }
      return b.toString();
View Full Code Here

      if (element instanceof OneOf) {
        if (!checkTagNumerIsUnique(e, message, ((OneOf) element).getElements())) {
          return false;
        }
      } else if (element instanceof IndexedElement) {
        IndexedElement other = (IndexedElement) element;
        if (other == e) {
          return true;
        }
        if (indexedElements.indexOf(other) == index) {
          QualifiedName messageName = qualifiedNameProvider.getFullyQualifiedName(message);
View Full Code Here

TOP

Related Classes of com.google.eclipse.protobuf.protobuf.IndexedElement

Copyright © 2018 www.massapicom. 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.