Package com.google.eclipse.protobuf.protobuf

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


*/
class CustomOptionFieldNameFinder {
  @Inject private Options options;

  Collection<IEObjectDescription> findFieldNamesSources(ComplexValue value, FinderStrategy strategy) {
    IndexedElement source = sourceOf(value);
    if (source == null) {
      return emptySet();
    }
    return strategy.findMessageFields(source);
  }
View Full Code Here


    }
    return strategy.findMessageFields(source);
  }

  private IndexedElement sourceOf(ComplexValue value) {
    IndexedElement source = null;
    EObject container = value.eContainer();
    if (container instanceof AbstractCustomOption) {
      AbstractCustomOption option = (AbstractCustomOption) container;
      source = options.sourceOf(option);
    }
View Full Code Here

    for (TypeExtension extension : messages.localExtensionsOf(fieldType)) {
      for (MessageElement element : extension.getElements()) {
        if (!(element instanceof IndexedElement)) {
          continue;
        }
        IndexedElement current = (IndexedElement) element;
        descriptions.addAll(qualifiedNameDescriptions.qualifiedNames(current, namingStrategy));
        String name = options.nameForOption(current);
        descriptions.add(create(name, current));
      }
    }
View Full Code Here

      highlight(option, acceptor);
    }
  }

  private void highlight(Option option, IHighlightedPositionAcceptor acceptor) {
    IndexedElement element = options.rootSourceOf(option);
    if (element != null) {
      highlightFirstFeature(option, OPTION__SOURCE, acceptor, DEFAULT_ID);
    }
    Value value = option.getValue();
    if (value instanceof LiteralLink) {
View Full Code Here

    if (model instanceof MessageField) {
      return (MessageField) model;
    }
    if (model instanceof AbstractOption) {
      AbstractOption option = (AbstractOption) model;
      IndexedElement source = options.rootSourceOf(option);
      if (source instanceof MessageField) {
        return (MessageField) source;
      }
    }
    return null;
View Full Code Here

  @Override public void completeCustomOption_Value(EObject model, Assignment assignment, ContentAssistContext context,
      ICompletionProposalAcceptor acceptor) {
    if (model instanceof CustomOption) {
      CustomOption option = (CustomOption) model;
      IndexedElement e = options.sourceOfLastFieldIn(option);
      if (e == null) {
        e = options.rootSourceOf(option);
      }
      if (e instanceof MessageField) {
        proposeFieldValue((MessageField) e, context, acceptor);
View Full Code Here

      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    // TODO content assist returns "{"
    if (model instanceof CustomFieldOption) {
      // TODO check if this is the same as sourceOf
      CustomFieldOption option = (CustomFieldOption) model;
      IndexedElement e = options.sourceOfLastFieldIn(option);
      if (e == null) {
        e = options.rootSourceOf(option);
      }
      if (e instanceof MessageField) {
        proposeFieldValue((MessageField) e, context, acceptor);
View Full Code Here

      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    if (model instanceof SimpleValueField) {
      SimpleValueField field = (SimpleValueField) model;
      FieldName name = field.getName();
      if (name != null) {
        IndexedElement target = name.getTarget();
        if (target instanceof MessageField) {
          proposeFieldValue((MessageField) target, context, acceptor);
        }
      }
    }
View Full Code Here

    }
    if (container instanceof AbstractOption) {
      AbstractOption option = (AbstractOption) container;
      if (options.isNative(option)) {
        ProtoDescriptor descriptor = descriptorProvider.primaryDescriptor();
        IndexedElement e = options.rootSourceOf(option);
        anEnum = descriptor.enumTypeOf((MessageField) e);
      }
    }
    if (container instanceof AbstractCustomOption) {
      AbstractCustomOption option = (AbstractCustomOption) container;
View Full Code Here

    return commentBuilder.toString().trim();
  }

  private EObject findRealTarget(EObject o) {
    if (o instanceof AbstractOption) {
      IndexedElement e = options.rootSourceOf((AbstractOption) o);
      return e != null ? e : o;
    }
    return o;
  }
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.