Examples of IEObjectDescription


Examples of org.eclipse.xtext.resource.IEObjectDescription

  private void removeDisqualifiedContainers(List<IEObjectDescription> descs, EObject o) {
    if(descs == null)
      return;
    ListIterator<IEObjectDescription> litor = descs.listIterator();
    while(litor.hasNext()) {
      IEObjectDescription x = litor.next();
      if(x.getEClass() == PPPackage.Literals.DEFINITION || !isParent(x, o))
        continue;
      litor.remove();
    }
  }
View Full Code Here

Examples of org.eclipse.xtext.resource.IEObjectDescription

    final String definitionURI = p.eResource().getURI().toString();

    int removedCount = 0;
    ListIterator<IEObjectDescription> litor = descs.listIterator();
    while(litor.hasNext()) {
      IEObjectDescription x = litor.next();
      URI xURI = x.getEObjectURI();
      // if in the same resource, and contain by the same EObject
      if(xURI.toString().startsWith(definitionURI) && xURI.fragment().startsWith(definitionFragment)) {
        litor.remove();
        removedCount++;
      }
View Full Code Here

Examples of org.eclipse.xtext.resource.IEObjectDescription

    final String definitionURI = d.eResource().getURI().toString();

    int removedCount = 0;
    ListIterator<IEObjectDescription> litor = descs.listIterator();
    while(litor.hasNext()) {
      IEObjectDescription x = litor.next();
      URI xURI = x.getEObjectURI();
      // if in the same resource, and contain by the same EObject
      if(xURI.toString().startsWith(definitionURI) && xURI.fragment().startsWith(definitionFragment)) {
        litor.remove();
        removedCount++;
      }
View Full Code Here

Examples of org.eclipse.xtext.resource.IEObjectDescription

          handleSetData(event);
        }

        protected void handleSetData(Event event) {
          TableItem item = (TableItem) event.item;
          IEObjectDescription description = (IEObjectDescription) item.getData();
          if(description != null) {
            StyledString styledString = styledLabelProvider.getStyledText(description);
            String displayString = styledString == null
                ? description.toString()
                : styledString.toString();
            StyleRange[] styleRanges = styledString.getStyleRanges();
            item.setText(displayString);
            TableOwnerDrawSupport.storeStyleRanges(item, 0, styleRanges);
          }
        }
      };
      table.addListener(SWT.SetData, listener);
    }
    messageLabel = new Label(parent, SWT.NONE);
    setDefaultGridData(messageLabel);
    EObjectDescriptionContentProvider contentProvider = new EObjectDescriptionContentProvider();
    getTableViewer().setContentProvider(contentProvider);
    getTableViewer().addSelectionChangedListener(new ISelectionChangedListener() {
      public void selectionChanged(SelectionChangedEvent event) {
        ISelection selection = event.getSelection();
        if(selection instanceof IStructuredSelection) {
          IStructuredSelection structuredSelection = (IStructuredSelection) selection;
          if(!structuredSelection.isEmpty()) {
            Object firstElement = structuredSelection.getFirstElement();
            if(firstElement instanceof IEObjectDescription) {
              IEObjectDescription eObjectDescription = (IEObjectDescription) firstElement;
              URI resourceURI = eObjectDescription.getEObjectURI().trimFragment();
              if(resourceURI.isPlatform()) {
                messageLabel.setText(resourceURI.toPlatformString(true));
              }
              else if(resourceURI.isFile()) {
                messageLabel.setText(resourceURI.toFileString());
View Full Code Here

Examples of org.eclipse.xtext.resource.IEObjectDescription

    }
  }

  protected IEObjectDescription findClosestExportedContainerDescriptor(EObject element,
      Iterable<IEObjectDescription> exportedElements) {
    IEObjectDescription closest = null;
    int maxSpecificity = 0;
    for(IEObjectDescription containerCandidate : exportedElements) {
      int specificity = containerSpecificity(
        EcoreUtil2.getNormalizedURI(element), containerCandidate.getEObjectURI());
      if(specificity > maxSpecificity) {
View Full Code Here

Examples of org.eclipse.xtext.resource.IEObjectDescription

              Resource r = eObj.eResource();
              Iterable<IEObjectDescription> exported = exportedObjectsByResourceCache.get(r);
              if(exported == null)
                exportedObjectsByResourceCache.put(r, exported = getExportedElements(r));
              // find the exported container closest to the source referencing the target
              IEObjectDescription closestExported = findClosestExportedContainerDescriptor(eObj, exported);
              IReferenceDescription refDesc = PPReferenceDescription.create(
                EcoreUtil2.getNormalizedURI(eObj), closestExported, targetCandidate);
              if(filter == null || filter.apply(refDesc))
                acceptor.accept(refDesc);
            }
View Full Code Here

Examples of org.eclipse.xtext.resource.IEObjectDescription

    // do meta lookup first as this is made fast via a cache and these are used more frequent
    // than other parameters (measured).
    if(metaCache == null)
      cacheMetaParameters(scopeDetermeningObject);
    IEObjectDescription d = metaCache.get(fqn.getLastSegment());
    if(d == null)
      result = findInherited(
        scopeDetermeningObject, fqn, importedNames, Lists.<QualifiedName> newArrayList(), Match.EQUALS,
        DEF_AND_TYPE_ARGUMENTS);
    else
View Full Code Here

Examples of org.eclipse.xtext.resource.IEObjectDescription

      if(containerName.getSegmentCount() > 0) {
        // there was a parent
        List<IEObjectDescription> parentResult = findExternal(
          scopeDetermeningObject, containerName, importedNames, Match.EQUALS, DEF_AND_TYPE).getAdjusted();
        if(!parentResult.isEmpty()) {
          IEObjectDescription firstFound = parentResult.get(0);
          String parentName = firstFound.getUserData(PPDSLConstants.PARENT_NAME_DATA);
          if(parentName != null && parentName.length() > 0) {
            // find attributes for parent

            QualifiedName attributeFqn = converter.toQualifiedName(parentName);
            attributeFqn = attributeFqn.append(fqn.getLastSegment());
View Full Code Here

Examples of org.eclipse.xtext.resource.IEObjectDescription

    if(name == null || name.length() < 1)
      return null;
    // find enclosing lambda
    for(EObject container = scopeDetermeningObject; container != null; container = container.eContainer()) {
      if(container instanceof Lambda) {
        IEObjectDescription desc = findLocalVariableInLambda(
          (Lambda) container, name, importedNames, matchingStrategy);
        if(desc != null)
          return desc;
      }
      if(container instanceof HostClassDefinition)
View Full Code Here

Examples of org.eclipse.xtext.resource.IEObjectDescription

    final boolean singleSegment = fqn.getSegmentCount() == 1;

    // If variable is a meta var, it is always found
    if(singleSegment) {
      IEObjectDescription metaVar = metaVarCache.get(fqn.getLastSegment());
      if(metaVar != null)
        return new SearchResult(Lists.newArrayList(metaVar), Lists.newArrayList(metaVar)); // what a waste...

      // if inside a define, all meta parameters are available
      if(isContainedInDefinition(scopeDetermeningObject)) {
        IEObjectDescription metaParam = metaCache.get(fqn.getLastSegment());
        if(metaParam != null)
          return new SearchResult(Lists.newArrayList(metaParam), Lists.newArrayList(metaParam)); // what a waste...
      }
      IEObjectDescription desc = findLocalVariables(scopeDetermeningObject, fqn, importedNames, matchingStrategy);
      if(desc != null)
        return new SearchResult(Lists.newArrayList(desc));

    }
    SearchResult result = findExternal(
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.