Package org.eclipse.dltk.ast.declarations

Examples of org.eclipse.dltk.ast.declarations.TypeDeclaration


        return;
      }
      if (nde.sourceStart() <= node.sourceStart() && node.sourceEnd() <= nde.sourceEnd()) {
        if (element instanceof IParent) {
          if (nde instanceof TypeDeclaration) {
            TypeDeclaration type = (TypeDeclaration) nde;
            String typeName = getNodeChildName(type);
            IModelElement e = findChildrenByName(typeName, element);
            if (e == null && type.getName().startsWith("::")) {
              try {
                e = (IModelElement) findTypeFrom(sourceModule.getChildren(), "", type.getName()
                        .replaceAll("::", "\\$"), '$');
              } catch (ModelException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
              }
View Full Code Here


      if (name.indexOf("::") != -1) {
        return name.substring(name.lastIndexOf("::") + 2);
      }
      return name;
    } else if (node instanceof TypeDeclaration) {
      TypeDeclaration type = (TypeDeclaration) node;
      String name = type.getName();
      /*
       * if (name.startsWith("::")) { return name.substring(2); }
       */
      return name;
    } else if (node instanceof Statement) {
View Full Code Here

        RutaEmptyCompleteStatement statement = new RutaEmptyCompleteStatement(exprs);
        method.getStatements().add(statement);
        this.parseBlockStatements(statement, method, position);
      } else if (node instanceof TypeDeclaration) {
        // empty keyword like completion.
        TypeDeclaration type = (TypeDeclaration) node;
        List exprs = new ArrayList();
        exprs.add(new SimpleReference(position, position, ""));
        RutaEmptyCompleteStatement statement = new RutaEmptyCompleteStatement(exprs);
        type.getStatements().add(statement);
        // this.assistNodeParent = node;
        this.parseBlockStatements(statement, type, position);
        // } else if (node instanceof RutaExecuteExpression) {
        // // empty keyword like completion.
        // List exprs = new ArrayList();
View Full Code Here

              RutaPreferenceConstants.EDITOR_VARIABLE_COLOR);
    }

    if (node instanceof TypeDeclaration) {

      TypeDeclaration t = (TypeDeclaration) node;
      List children;

      // Handle base classes highlighting
      ASTListNode s = t.getSuperClasses();

      if (s != null && s.getChilds() != null) {
        children = s.getChilds();
        Iterator it = children.iterator();
        while (it.hasNext()) {
          ASTNode n = (ASTNode) it.next();
          requestor.addPosition(n.sourceStart(), n.sourceEnd(),
                  RutaPreferenceConstants.EDITOR_DECLARATION_DEFINITION_COLOR);
        }
      }

      requestor.addPosition(t.getNameStart(), t.getNameEnd(),
              RutaPreferenceConstants.EDITOR_VARIABLE_COLOR);
    }

    return null;
View Full Code Here

    for (Iterator iterator = statements.iterator(); iterator.hasNext();) {
      ASTNode node = (ASTNode) iterator.next();
      if (node instanceof RutaStatement) {
        checkStatement(code, offset, result, (Statement) node);
      } else if (node instanceof TypeDeclaration) {
        TypeDeclaration statement = (TypeDeclaration) node;
        result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
                .sourceEnd() - statement.sourceStart())));
        traverse(result, statement.getStatements(), offset, code);
      } else if (node instanceof MethodDeclaration) {
        MethodDeclaration statement = (MethodDeclaration) node;
        result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
                .sourceEnd() - statement.sourceStart())));
        traverse(result, statement.getStatements(), offset, code);
      }
    }
  }
View Full Code Here

    for (Iterator iterator = statements.iterator(); iterator.hasNext();) {
      ASTNode node = (ASTNode) iterator.next();
      if (node instanceof RutaStatement) {
        checkStatement(code, offset, result, (Statement) node);
      } else if (node instanceof TypeDeclaration) {
        TypeDeclaration statement = (TypeDeclaration) node;
        result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
                .sourceEnd() - statement.sourceStart())));
        traverse(result, statement.getStatements(), offset, code);
      } else if (node instanceof MethodDeclaration) {
        MethodDeclaration statement = (MethodDeclaration) node;
        result.add(new CodeBlock(statement, new Region(offset + statement.sourceStart(), statement
                .sourceEnd() - statement.sourceStart())));
        traverse(result, statement.getStatements(), offset, code);
      }
    }
  }
View Full Code Here

        return;
      }
      if (nde.sourceStart() <= node.sourceStart() && node.sourceEnd() <= nde.sourceEnd()) {
        if (element instanceof IParent) {
          if (nde instanceof TypeDeclaration) {
            TypeDeclaration type = (TypeDeclaration) nde;
            String typeName = getNodeChildName(type);
            IModelElement e = findChildrenByName(typeName, element);
            if (e == null && type.getName().startsWith("::")) {
              try {
                e = (IModelElement) findTypeFrom(sourceModule.getChildren(), "", type.getName()
                        .replaceAll("::", "\\$"), '$');
              } catch (ModelException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
              }
View Full Code Here

      if (name.indexOf("::") != -1) {
        return name.substring(name.lastIndexOf("::") + 2);
      }
      return name;
    } else if (node instanceof TypeDeclaration) {
      TypeDeclaration type = (TypeDeclaration) node;
      String name = type.getName();
      /*
       * if (name.startsWith("::")) { return name.substring(2); }
       */
      return name;
    } else if (node instanceof Statement) {
View Full Code Here

      requestor.addPosition(m.getNameStart(), m.getNameEnd(), RutaPreferenceConstants.EDITOR_VARIABLE_COLOR);
    }

    if (node instanceof TypeDeclaration) {

      TypeDeclaration t = (TypeDeclaration) node;
      List children;

      // Handle base classes highlighting
      ASTListNode s = t.getSuperClasses();

      if (s != null && s.getChilds() != null) {
        children = s.getChilds();
        Iterator it = children.iterator();
        while (it.hasNext()) {
          ASTNode n = (ASTNode) it.next();
          requestor.addPosition(n.sourceStart(), n.sourceEnd(), RutaPreferenceConstants.EDITOR_DECLARATION_DEFINITION_COLOR);
        }
      }

      requestor.addPosition(t.getNameStart(), t.getNameEnd(), RutaPreferenceConstants.EDITOR_VARIABLE_COLOR);
    }

    return null;

  }
View Full Code Here

    String path = null;
    if (type != null) {
      ISourceModule sourceModule = type.getSourceModule();
      ModuleDeclaration moduleDeclaration = SourceParserUtil
          .getModuleDeclaration(sourceModule);
      TypeDeclaration typeDeclaration = PHPModelUtils.getNodeByClass(
          moduleDeclaration, type);
      path = getPHPDocLink(typeDeclaration);

      if (path == null) {
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.ast.declarations.TypeDeclaration

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.