Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IType


   * @throws JavaModelException
   */
  protected IType getTypeOfAnnotation(IAnnotation anno, IType relative_type) throws JavaModelException {
    IJavaProject project = anno.getJavaProject();
    Pair<String,String> name = getQualifiedAnnoType(anno, relative_type);
    IType anno_type = project.findType(name.fst(), name.snd());
   
    return anno_type;
  }
View Full Code Here


    ICrystalAnnotation crystalAnno;

    Pair<String,String> qual_name_ = getQualifiedAnnoType(anno, relative_type);
    qualName = "".equals(qual_name_.fst()) ? qual_name_.snd() : qual_name_.fst() + "." + qual_name_.snd();

    IType anno_type = getTypeOfAnnotation(anno, relative_type);
    crystalAnno = createCrystalAnnotation(anno_type);
    crystalAnno.setName(qualName);

    // These members have a value that is not default.
    Set<String> has_non_default_value = new HashSet<String>();
View Full Code Here

   * See {@link #isMulti(IAnnotationBinding)}.
   * @throws JavaModelException
   */
  public boolean isMulti(IAnnotation anno, IType relative_type) throws JavaModelException {
    // First we have to go from this particular annotation, to its declaration...
    IType anno_type = getTypeOfAnnotation(anno, relative_type);

    for (IAnnotation meta : anno_type.getAnnotations()) {
      Pair<String,String> qual_name_ = getQualifiedAnnoType(meta, anno_type);
      String qual_name = "".equals(qual_name_.fst()) ? qual_name_.snd() : qual_name_.fst() + "." + qual_name_.snd();
      if (qual_name.equals(MultiAnnotation.class.getName()))
        return true;
    }
View Full Code Here

   * @throws JavaModelException
   */
  protected IType getTypeOfAnnotation(IAnnotation anno, IType relative_type) throws JavaModelException {
    IJavaProject project = anno.getJavaProject();
    Pair<String,String> name = getQualifiedAnnoType(anno, relative_type);
    IType anno_type = project.findType(name.fst(), name.snd());
   
    return anno_type;
  }
View Full Code Here

    ICrystalAnnotation crystalAnno;

    Pair<String,String> qual_name_ = getQualifiedAnnoType(anno, relative_type);
    qualName = "".equals(qual_name_.fst()) ? qual_name_.snd() : qual_name_.fst() + "." + qual_name_.snd();

    IType anno_type = getTypeOfAnnotation(anno, relative_type);
    crystalAnno = createCrystalAnnotation(anno_type);
    crystalAnno.setName(qualName);

    // These members have a value that is not default.
    Set<String> has_non_default_value = new HashSet<String>();
View Full Code Here

   * See {@link #isMulti(IAnnotationBinding)}.
   * @throws JavaModelException
   */
  public boolean isMulti(IAnnotation anno, IType relative_type) throws JavaModelException {
    // First we have to go from this particular annotation, to its declaration...
    IType anno_type = getTypeOfAnnotation(anno, relative_type);

    for (IAnnotation meta : anno_type.getAnnotations()) {
      Pair<String,String> qual_name_ = getQualifiedAnnoType(meta, anno_type);
      String qual_name = "".equals(qual_name_.fst()) ? qual_name_.snd() : qual_name_.fst() + "." + qual_name_.snd();
      if (qual_name.equals(MULTI_ANNOTATION_CLASSNAME))
        return true;
    }
View Full Code Here

   * @param doClasses
   * @return the new typeNode for this type, fully completed
   */
  private void loadNewTree(String qName) {
    try {
      IType baseType = project.findType(qName);
     
      if (baseType != null) {
        ITypeHierarchy hierarchy = baseType.newTypeHierarchy(project, null);   
        addInHierarchy(baseType, hierarchy);     
       
        //Yeah...that just wasted a bunch of resources. Clean up now...
        Runtime r = Runtime.getRuntime();
        r.gc();
View Full Code Here

        createFileFromTemplate(webInfFolder, "web.xml", "web.xml", variables);
      }
      // open entry point in editor
      {
        String qualifiedEntryPoint = packageName + ".client." + moduleName;
        IType type = WorkspaceUtils.waitForType(root.getJavaProject(), qualifiedEntryPoint);
        IDE.openEditor(
            DesignerPlugin.getActivePage(),
            (IFile) type.getUnderlyingResource(),
            IDesignerEditor.ID);
      }
    } else {
      // create empty module
      file =
View Full Code Here

        IJavaProject javaProject = element.getJavaProject();
        if (Utils.isGWTProject(javaProject)) {
          IPackageFragmentRoot testSourceFragmentRoot = handleTestSourceFolder(javaProject);
          IPackageFragment elementPackage = handleTestPackage(element, testSourceFragmentRoot);
          // handle class under test
          IType classUnderTestType = (IType) element.getAncestor(IJavaElement.TYPE);
          if (classUnderTestType == null) {
            ICompilationUnit compilationUnit =
                (ICompilationUnit) element.getAncestor(IJavaElement.COMPILATION_UNIT);
            if (compilationUnit != null) {
              classUnderTestType = compilationUnit.findPrimaryType();
            }
          }
          if (classUnderTestType == null) {
            setErrorState();
          } else {
            m_classUnderTestField.setText(classUnderTestType.getFullyQualifiedName());
            setTypeName(classUnderTestType.getElementName() + "Test", true);
            m_classUnderTestStatus =
                new Status(IStatus.OK, Activator.PLUGIN_ID, IStatus.OK, null, null);
            //
            ModuleDescription module = Utils.getSingleModule(elementPackage);
            if (module == null) {
              setErrorState("GWT module for "
                  + classUnderTestType.getFullyQualifiedName()
                  + " not found.");
            } else {
              m_moduleId = module.getId();
            }
          }
View Full Code Here

    fillTypeFromTemplate(newType, imports, monitor, template);
    m_javaFile = (IFile) newType.getUnderlyingResource();
  }

  protected void createUI() throws Exception {
    IType newType = getCreatedType();
    // prepare template
    String template;
    {
      String templatePath = getTemplatePath_UI();
      InputStream templateStream = Activator.getFile(templatePath);
      template = IOUtils2.readString(templateStream);
    }
    // prepare content
    String content;
    {
      String qualifiedTypeName = newType.getFullyQualifiedName();
      content = StringUtils.replace(template, "%TypeName%", qualifiedTypeName);
    }
    // create UiBinder file
    IFolder folder = (IFolder) getPackageFragment().getUnderlyingResource();
    m_uiFile = folder.getFile(newType.getElementName() + ".ui.xml");
    IOUtils2.setFileContents(m_uiFile, content);
    m_uiFile.setCharset("UTF-8", null);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.IType

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.