Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EObject


  public TargetPlatformProposalProvider() {
  }
 
  public void complete_TargetPlatform(final EObject model, final RuleCall ruleCall, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
    INode _currentNode = context.getCurrentNode();
    EObject _grammarElement = _currentNode.getGrammarElement();
    TargetPlatformGrammarAccess.TargetPlatformElements _targetPlatformAccess = this.grammarAccess.getTargetPlatformAccess();
    Keyword _targetKeyword_0 = _targetPlatformAccess.getTargetKeyword_0();
    boolean _notEquals = (!Objects.equal(_grammarElement, _targetKeyword_0));
    if (_notEquals) {
      TargetPlatformGrammarAccess.TargetPlatformElements _targetPlatformAccess_1 = this.grammarAccess.getTargetPlatformAccess();
View Full Code Here


 
  public void completeTargetPlatform_Name(final EObject model, final Assignment assignment, final ContentAssistContext context, final ICompletionProposalAcceptor acceptor) {
    String textProposal = null;
    int offset = 0;
    INode _currentNode = context.getCurrentNode();
    EObject _grammarElement = _currentNode.getGrammarElement();
    TargetPlatformGrammarAccess.TargetPlatformElements _targetPlatformAccess = this.grammarAccess.getTargetPlatformAccess();
    Keyword _targetKeyword_0 = _targetPlatformAccess.getTargetKeyword_0();
    boolean _equals = Objects.equal(_grammarElement, _targetKeyword_0);
    if (_equals) {
      StringConcatenation _builder = new StringConcatenation();
View Full Code Here

    final Resource resource = EcoreUtil2.getResource(context, _resolve);
    EList<EObject> _contents = null;
    if (resource!=null) {
      _contents=resource.getContents();
    }
    EObject _head = null;
    if (_contents!=null) {
      _head=IterableExtensions.<EObject>head(_contents);
    }
    EObject root = _head;
    if ((root instanceof TargetPlatform)) {
      ret = ((TargetPlatform) root);
    }
    return ret;
  }
View Full Code Here

    String _version = iu.getVersion();
    boolean _notEquals = (!Objects.equal(_version, null));
    if (_notEquals) {
      final List<INode> nodes = NodeModelUtils.findNodesForFeature(iu, TargetPlatformPackage.Literals.IU__VERSION);
      INode _head = IterableExtensions.<INode>head(nodes);
      EObject _grammarElement = _head.getGrammarElement();
      AbstractRule _rule = ((RuleCall) _grammarElement).getRule();
      String _name = _rule.getName();
      boolean _equals = "STRING".equals(_name);
      if (_equals) {
        this.warning("Usage of strings is deprecated for version range. You should remove the quotes.", iu,
View Full Code Here

  public void checkNoEscapeCharacterInIUID(final IU iu) {
    final ICompositeNode node = NodeModelUtils.getNode(iu);
    BidiTreeIterable<INode> _asTreeIterable = node.getAsTreeIterable();
    final Function1<INode, Boolean> _function = new Function1<INode, Boolean>() {
      public Boolean apply(final INode it) {
        EObject _grammarElement = it.getGrammarElement();
        TargetPlatformGrammarAccess.IUElements _iUAccess = TargetPlatformValidator.this.grammarAccess.getIUAccess();
        RuleCall _iDIDTerminalRuleCall_0_0 = _iUAccess.getIDIDTerminalRuleCall_0_0();
        return Boolean.valueOf(Objects.equal(_grammarElement, _iDIDTerminalRuleCall_0_0));
      }
    };
View Full Code Here

  public void checkVersionKeywords(final IU iu) {
    final ICompositeNode node = NodeModelUtils.getNode(iu);
    BidiTreeIterable<INode> _asTreeIterable = node.getAsTreeIterable();
    final Function1<INode, Boolean> _function = new Function1<INode, Boolean>() {
      public Boolean apply(final INode it) {
        EObject _grammarElement = it.getGrammarElement();
        TargetPlatformGrammarAccess.IUElements _iUAccess = TargetPlatformValidator.this.grammarAccess.getIUAccess();
        Keyword _semicolonKeyword_1_0_0 = _iUAccess.getSemicolonKeyword_1_0_0();
        return Boolean.valueOf(Objects.equal(_grammarElement, _semicolonKeyword_1_0_0));
      }
    };
    final INode semicolonKeywordRule = IterableExtensions.<INode>findFirst(_asTreeIterable, _function);
    BidiTreeIterable<INode> _asTreeIterable_1 = node.getAsTreeIterable();
    final Function1<INode, Boolean> _function_1 = new Function1<INode, Boolean>() {
      public Boolean apply(final INode it) {
        EObject _grammarElement = it.getGrammarElement();
        TargetPlatformGrammarAccess.IUElements _iUAccess = TargetPlatformValidator.this.grammarAccess.getIUAccess();
        Keyword _equalsSignKeyword_1_0_2 = _iUAccess.getEqualsSignKeyword_1_0_2();
        return Boolean.valueOf(Objects.equal(_grammarElement, _equalsSignKeyword_1_0_2));
      }
    };
View Full Code Here

  public String toValue(final String string, final INode node) {
    boolean _equals = Objects.equal(string, null);
    if (_equals) {
      return null;
    }
    EObject _grammarElement = node.getGrammarElement();
    final RuleCall ge = ((RuleCall) _grammarElement);
    EObject _eContainer = ge.eContainer();
    final Assignment container = ((Assignment) _eContainer);
    int _length = string.length();
    int _minus = (_length - 1);
    String _substring = string.substring(1, _minus);
    final String value = Strings.convertFromJavaString(_substring, true);
View Full Code Here

      final List<FeatureBasedDiagnostic> diagnostics = IterableExtensions.<FeatureBasedDiagnostic>toList(_filter);
      String _join = IterableExtensions.join(diagnostics, ", ");
      int _size = diagnostics.size();
      Assert.assertEquals(_join, 2, _size);
      FeatureBasedDiagnostic _get = diagnostics.get(0);
      EObject _sourceEObject = _get.getSourceEObject();
      FeatureBasedDiagnostic _get_1 = diagnostics.get(0);
      EStructuralFeature _feature = _get_1.getFeature();
      Object _eGet = _sourceEObject.eGet(_feature);
      FeatureBasedDiagnostic _get_2 = diagnostics.get(0);
      int _index = _get_2.getIndex();
      Object _get_3 = ((List<?>) _eGet).get(_index);
      Assert.assertEquals(Option.INCLUDE_SOURCE, _get_3);
      FeatureBasedDiagnostic _get_4 = diagnostics.get(1);
      EObject _sourceEObject_1 = _get_4.getSourceEObject();
      FeatureBasedDiagnostic _get_5 = diagnostics.get(1);
      EStructuralFeature _feature_1 = _get_5.getFeature();
      Object _eGet_1 = _sourceEObject_1.eGet(_feature_1);
      FeatureBasedDiagnostic _get_6 = diagnostics.get(1);
      int _index_1 = _get_6.getIndex();
      Object _get_7 = ((List<?>) _eGet_1).get(_index_1);
      Assert.assertEquals(Option.INCLUDE_SOURCE, _get_7);
    } catch (Throwable _e) {
View Full Code Here

      int _size = diagnostics.size();
      Assert.assertEquals(_join, 2, _size);
      EList<TargetContent> _contents = targetPlatform.getContents();
      TargetContent _get = _contents.get(0);
      FeatureBasedDiagnostic _get_1 = diagnostics.get(0);
      EObject _sourceEObject = _get_1.getSourceEObject();
      Assert.assertEquals(_get, _sourceEObject);
      FeatureBasedDiagnostic _get_2 = diagnostics.get(0);
      EObject _sourceEObject_1 = _get_2.getSourceEObject();
      FeatureBasedDiagnostic _get_3 = diagnostics.get(0);
      EStructuralFeature _feature = _get_3.getFeature();
      Object _eGet = _sourceEObject_1.eGet(_feature);
      FeatureBasedDiagnostic _get_4 = diagnostics.get(0);
      int _index = _get_4.getIndex();
      Object _get_5 = ((List<?>) _eGet).get(_index);
      Assert.assertEquals(Option.INCLUDE_CONFIGURE_PHASE, _get_5);
      EList<TargetContent> _contents_1 = targetPlatform.getContents();
      TargetContent _get_6 = _contents_1.get(1);
      FeatureBasedDiagnostic _get_7 = diagnostics.get(1);
      EObject _sourceEObject_2 = _get_7.getSourceEObject();
      Assert.assertEquals(_get_6, _sourceEObject_2);
      FeatureBasedDiagnostic _get_8 = diagnostics.get(1);
      EObject _sourceEObject_3 = _get_8.getSourceEObject();
      FeatureBasedDiagnostic _get_9 = diagnostics.get(1);
      EStructuralFeature _feature_1 = _get_9.getFeature();
      Object _eGet_1 = _sourceEObject_3.eGet(_feature_1);
      FeatureBasedDiagnostic _get_10 = diagnostics.get(1);
      int _index_1 = _get_10.getIndex();
      Object _get_11 = ((List<?>) _eGet_1).get(_index_1);
      Assert.assertEquals(Option.INCLUDE_CONFIGURE_PHASE, _get_11);
    } catch (Throwable _e) {
View Full Code Here

      final List<AbstractValidationDiagnostic> diagnotics = IterableExtensions.<AbstractValidationDiagnostic>toList(_filter);
      int _size = diagnotics.size();
      Assert.assertEquals(2, _size);
      final Function1<AbstractValidationDiagnostic, Boolean> _function = new Function1<AbstractValidationDiagnostic, Boolean>() {
        public Boolean apply(final AbstractValidationDiagnostic it) {
          EObject _sourceEObject = it.getSourceEObject();
          return Boolean.valueOf((_sourceEObject instanceof Location));
        }
      };
      boolean _forall = IterableExtensions.<AbstractValidationDiagnostic>forall(diagnotics, _function);
      Assert.assertTrue(_forall);
      final Procedure1<AbstractValidationDiagnostic> _function_1 = new Procedure1<AbstractValidationDiagnostic>() {
        public void apply(final AbstractValidationDiagnostic it) {
          String _issueCode = it.getIssueCode();
          Assert.assertEquals(TargetPlatformValidator.CHECK__LOCATION_ID_UNIQNESS, _issueCode);
        }
      };
      IterableExtensions.<AbstractValidationDiagnostic>forEach(diagnotics, _function_1);
      AbstractValidationDiagnostic _get = diagnotics.get(0);
      EObject _sourceEObject = _get.getSourceEObject();
      String _uri = ((Location) _sourceEObject).getUri();
      Assert.assertEquals("mylocationURI2", _uri);
      AbstractValidationDiagnostic _get_1 = diagnotics.get(1);
      EObject _sourceEObject_1 = _get_1.getSourceEObject();
      String _uri_1 = ((Location) _sourceEObject_1).getUri();
      Assert.assertEquals("mylocationURI", _uri_1);
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.EObject

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.