Package org.eclipse.dltk.internal.core

Examples of org.eclipse.dltk.internal.core.ModelElement


  }

  protected void sortElements(IModelElement[] elements) {
    Comparer comparer = new Comparer() {
      public int compare(Object a, Object b) {
        ModelElement elementA = (ModelElement) a;
        ModelElement elementB = (ModelElement) b;
        // char[] tempJCLPath = "<externalJCLPath>".toCharArray();
        // String idA = new String(CharOperation.replace(
        // elementA.toStringWithAncestors().toCharArray(),
        // getExternalJCLPathString().toCharArray(),
        // tempJCLPath));
        // String idB = new String(CharOperation.replace(
        // elementB.toStringWithAncestors().toCharArray(),
        // getExternalJCLPathString().toCharArray(),
        // tempJCLPath));
        return elementA.toStringWithAncestors().compareTo(
            elementB.toStringWithAncestors().toString());
        // return idA.compareTo(idB);
      }
    };
    org.eclipse.dltk.internal.core.util.Util.sort(elements, comparer);
  }
View Full Code Here


  protected void assertElementsEqual(String message, String expected,
      IModelElement[] elements, boolean showResolvedInfo) {
    StringBuffer buffer = new StringBuffer();
    if (elements != null) {
      for (int i = 0, length = elements.length; i < length; i++) {
        ModelElement element = (ModelElement) elements[i];
        if (element == null) {
          buffer.append("<null>");
        } else {
          buffer.append(element
              .toStringWithAncestors(showResolvedInfo));
        }
        if (i != length - 1)
          buffer.append("\n");
      }
View Full Code Here

        @SuppressWarnings("unchecked")
        @Override
        public int compare(Viewer viewer, Object e1, Object e2)
        {
            ModelElement left = null;
            ModelElement right = null;
            if (e1 instanceof Service && e2 instanceof Service) {
                left = (Service) e1;
                right = (Service) e2;
            } else if (e1 instanceof Bundle && e2 instanceof Bundle) {
                left = (Bundle) e1;
                right = (Bundle) e2;
            }

            if (left != null && right != null) {
                int result = getComparator().compare(left.getElementName(), right.getElementName());

                if (!ascending) {
                    result *= -1;
                }
                return result;
View Full Code Here

        for(Service service : services) {
            if (CodeAssistUtils.startsWithIgnoreCase(service.getId(), prefix)) {
             
                IType[] serviceTypes = model.findServiceTypes(service, project);
                ModelElement parent = null;
               
                if (serviceTypes.length > 0) {
                    parent = (ModelElement) serviceTypes[0];
                } else {
                    parent = (ModelElement) context.getSourceModule();
View Full Code Here

                  }
                } else {
                  bundleTypes = PhpModelAccess.getDefault().findTypes(b.getElementName(), MatchRule.EXACT, 0, 0, projectScope, null);
                }
                if (bundleTypes.length == 1) {
                    ModelElement bType = (ModelElement) bundleTypes[0];
                    if (CodeAssistUtils.startsWithIgnoreCase(bType.getElementName(), prefix)) {
                        Bundle bundleType = new Bundle(bType, b.getElementName());
                        reporter.reportType(bundleType, ":", range);
                    }
                }
            }
View Full Code Here

               
                IType[] bundleTypes = PhpModelAccess.getDefault().findTypes(b.getElementName(), MatchRule.EXACT, 0, 0, projectScope, null);
               
                if (bundleTypes.length == 1) {
                   
                    ModelElement bType = (ModelElement) bundleTypes[0];
                   
                    if (CodeAssistUtils.startsWithIgnoreCase(bType.getElementName(), prefix)) {
                        Bundle bundleType = new Bundle(bType, b.getElementName());
                        reporter.reportType(bundleType, ":", range);                       
                    }
                }
            }          
View Full Code Here

          String className = (String) data.get("elementName");
          String q = (String) data.get("qualifier");
          String viewPath = (String) data.get("viewPath");
          String method = (String) data.get("method");
         
          ModelElement parentElement = (ModelElement) sourceModule;

          if (qualifier != null) {
            parentElement = new ControllerType(parentElement, qualifier,
                Modifiers.AccNameSpace, 0, 0, 0, 0, null, doc);

            return new TemplateField(parentElement, elementName, q, className, viewPath, method);

          }     
        } else if (type.equals("scalar")) {
         
          JSONObject data = JsonUtils.getScalar(metadata);

          String className = (String) data.get("elementName");
          String viewPath = (String) data.get("viewPath");
          String method = (String) data.get("method");
         
          ModelElement parentElement = (ModelElement) sourceModule;
          return new TemplateField(parentElement, elementName, null, className, viewPath, method);     

        }
      } catch (Exception e) {
        Logger.logException(e);
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.internal.core.ModelElement

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.