Examples of findPrimaryType()


Examples of org.eclipse.jdt.core.ICompilationUnit.findPrimaryType()

      if (elem instanceof ICompilationUnit) {
        ICompilationUnit unit = (ICompilationUnit) elem;
       
        try {
          if (elem.getElementType() == IJavaElement.COMPILATION_UNIT) {
            IType primaryType = unit.findPrimaryType();
            if (primaryType.exists() && primaryType.isInterface()) {
              String interfaceName = SuperInterfaceSelectionDialog.getNameWithTypeParameters(primaryType);
              if (interfaceName != null) {
                interfaces.add(interfaceName);
              }
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.findPrimaryType()

     
      // auto-populate superclass from selection (if WOComponent assignable)
      if (elem instanceof ICompilationUnit) {
        ICompilationUnit unit = (ICompilationUnit) elem;
        try {
          IType primaryType = unit.findPrimaryType();
          if (primaryType != null) {
            ITypeHierarchy supertypeHierarchy = primaryType.newSupertypeHierarchy(new NullProgressMonitor());
            if (supertypeHierarchy.contains(getDefaultWOComponentType())) {
              setSuperClass(primaryType.getFullyQualifiedName(), true);
            }
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.findPrimaryType()

  private boolean isValidSubclass(IJavaElement javaElement) throws JavaModelException {
    if (superclasses == null || superclasses.length == 0) {
      return true;
    }
    ICompilationUnit compilationUnit = (ICompilationUnit) javaElement;
    IType typeToCeck = compilationUnit.findPrimaryType();
    ITypeHierarchy typeHierarchy = typeToCeck.newSupertypeHierarchy(new NullProgressMonitor());
    IType[] types = typeHierarchy.getAllClasses();
    for (int i = 0; i < types.length; i++) {
      IType type = types[i];
      for (int j = 0; j < superclasses.length; j++) {
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.findPrimaryType()

    if (_validateTemplatesNow) {
      try {
        if (_buildKind == IncrementalProjectBuilder.INCREMENTAL_BUILD || _buildKind == IncrementalProjectBuilder.AUTO_BUILD) {
          ICompilationUnit compilationUnit = JavaCore.createCompilationUnitFrom((IFile) resource);
          if (compilationUnit != null) {
            IType type = compilationUnit.findPrimaryType();
            if (type != null) {
              IType woElementType = type.getJavaProject().findType("com.webobjects.appserver.WOElement", progressMonitor);
              if (woElementType != null) {
                ITypeHierarchy typeHierarchy = SuperTypeHierarchyCache.getTypeHierarchy(type, progressMonitor);
                if (typeHierarchy != null && typeHierarchy.contains(woElementType)) {
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.findPrimaryType()

        if (element instanceof ICompilationUnit) {
            cu = (ICompilationUnit) element;
        } else if (element instanceof IMember) {
            cu = ((IMember) element).getCompilationUnit();
        }
        return cu != null ? cu.findPrimaryType() : null;
    }
   
    public static boolean isTestClass(IType type) throws JavaModelException {
        ITypeHierarchy superTypeHierarchy = type.newSupertypeHierarchy(null);
        IType superTypes[] = superTypeHierarchy.getAllInterfaces();
View Full Code Here

Examples of org.eclipse.jdt.core.ICompilationUnit.findPrimaryType()

        if (type != null)
            return type;
        ICompilationUnit unit = getCompilationUnitOfJavaEditor();
        if (unit == null)
            return null;
        return unit.findPrimaryType();
    }

    private IType getTypeOfJavaElement() {
        return JavaElements.getPrimaryTypeOf(javaElement);
    }
View Full Code Here

Examples of org.eclipse.jdt.core.ITypeRoot.findPrimaryType()

    try {

      CompilationUnit compilationUnit = context.getAST3();
      ITypeRoot typeRoot = compilationUnit.getTypeRoot();
      IType type = typeRoot.findPrimaryType();

      // Skip non-interfaces
      if (type == null || !type.isInterface() || type.isAnnotation()) {
        super.reconcile(context);
        return;
View Full Code Here

Examples of org.eclipse.jdt.core.ITypeRoot.findPrimaryType()

      SpringDataValidationContext context, IProgressMonitor monitor) {

    try {

      ITypeRoot typeRoot = element.getTypeRoot();
      IType type = typeRoot.findPrimaryType();

      if (!supports(typeRoot))
        return;

      // resolve repository information and generate problem markers
View Full Code Here

Examples of org.eclipse.jdt.core.ITypeRoot.findPrimaryType()

      if (typeRoot == null) {
        return false;
      }

      IType type = typeRoot.findPrimaryType();
      if (type == null) {
        return false;
      }

      // Skip non-interfaces
View Full Code Here

Examples of org.eclipse.jdt.core.ITypeRoot.findPrimaryType()

  public void validate(CompilationUnit element,
      SpringDataValidationContext context, IProgressMonitor monitor) {

    ITypeRoot typeRoot = element.getTypeRoot();
    IType type = typeRoot.findPrimaryType();

    // resolve repository information and generate problem markers
    RepositoryInformation information = new RepositoryInformation(type);

    Class<?> domainClass = information.getManagedDomainClass();
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.