Package com.google.eclipse.protobuf.protobuf

Examples of com.google.eclipse.protobuf.protobuf.Enum


  // syntax = "proto2";
  //
  // enum PhoneType {}
  @Test public void should_return_name_of_Enum() {
    Enum anEnum = xtext.find("PhoneType", Enum.class);
    String name = resolver.nameOf(anEnum);
    assertThat(name, equalTo("PhoneType"));
  }
View Full Code Here


  //       WORK = 1;
  //     }
  //   }
  // }
  @Test public void should_return_all_possible_local_names() {
    Enum phoneType = xtext.find("PhoneType", " {", Enum.class);
    List<QualifiedName> names = namesProvider.localNames(phoneType, normalNamingStrategy);
    assertThat(names.get(0).toString(), equalTo("PhoneType"));
    assertThat(names.get(1).toString(), equalTo("PhoneNumber.PhoneType"));
    assertThat(names.get(2).toString(), equalTo("Person.PhoneNumber.PhoneType"));
    assertThat(names.get(3).toString(), equalTo("names.Person.PhoneNumber.PhoneType"));
View Full Code Here

    MessageField optionSource = (MessageField) options.rootSourceOf(option);
    if (optionSource == null) {
      return;
    }
    ProtoDescriptor descriptor = descriptorProvider.primaryDescriptor();
    Enum enumType = descriptor.enumTypeOf(optionSource);
    if (enumType != null) {
      proposeAndAccept(enumType, context, acceptor);
      return;
    }
    proposePrimitiveValues(optionSource, context, acceptor);
View Full Code Here

      field = (MessageField) model.eContainer();
    }
    if (field == null || !messageFields.isOptional(field)) {
      return;
    }
    Enum enumType = messageFields.enumTypeOf(field);
    if (enumType != null) {
      proposeAndAccept(enumType, context, acceptor);
    }
  }
View Full Code Here

      ContentAssistContext context, ICompletionProposalAcceptor acceptor) {
    if (model instanceof NativeFieldOption) {
      NativeFieldOption option = (NativeFieldOption) model;
      ProtoDescriptor descriptor = descriptorProvider.primaryDescriptor();
      MessageField field = (MessageField) options.rootSourceOf(option);
      Enum enumType = descriptor.enumTypeOf(field);
      if (enumType != null) {
        proposeAndAccept(enumType, context, acceptor);
        return;
      }
      proposePrimitiveValues(field, context, acceptor);
View Full Code Here

  private void proposeFieldValue(MessageField field, ContentAssistContext context,
      ICompletionProposalAcceptor acceptor) {
    if (field == null || proposePrimitiveValues(field, context, acceptor)) {
      return;
    }
    Enum enumType = messageFields.enumTypeOf(field);
    if (enumType != null) {
      proposeAndAccept(enumType, context, acceptor);
    }
  }
View Full Code Here

  }

  @SuppressWarnings("unused")
  public IScope scope_LiteralLink_target(LiteralLink link, EReference r) {
    EObject container = link.eContainer();
    Enum anEnum = null;
    if (container instanceof DefaultValueFieldOption) {
      container = container.eContainer();
    }
    if (container instanceof AbstractOption) {
      AbstractOption option = (AbstractOption) container;
View Full Code Here

  // syntax = "proto2";
  //
  // enum PhoneType {}
  @Test public void should_return_image_for_enum() {
    Enum anEnum = xtext.find("PhoneType", Enum.class);
    String image = images.imageFor(anEnum);
    assertThat(image, equalTo("enum.gif"));
    assertThat(image, existsInProject());
  }
View Full Code Here

    }
    if (messageFields.isBytes(field) || messageFields.isString(field)) {
      validateString(option);
      return;
    }
    Enum anEnum = messageFields.enumTypeOf(field);
    if (anEnum != null) {
      validateEnumLiteral(option, anEnum);
    }
  }
View Full Code Here

TOP

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

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.