Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IType


  /**
   * Test for {@link Utils#getSingleModule(ICompilationUnit)}.
   */
  public void test_getSingleModule_ICompilationUnit() throws Exception {
    IType entryPointType = m_testProject.getJavaProject().findType("test.client.Module");
    ICompilationUnit compilationUnit = entryPointType.getCompilationUnit();
    assertModuleDescriptionPath("src/test/Module.gwt.xml", Utils.getSingleModule(compilationUnit));
  }
View Full Code Here


  /**
   * Test for {@link Utils#getSingleModule(IPackageFragment)}.
   */
  public void test_getSingleModule_IPackageFragment() throws Exception {
    IType entryPointType = m_testProject.getJavaProject().findType("test.client.Module");
    IPackageFragment packageFragment = entryPointType.getPackageFragment();
    assertModuleDescriptionPath("src/test/Module.gwt.xml", Utils.getSingleModule(packageFragment));
  }
View Full Code Here

  /**
   * Test for {@link Utils#getSingleModule(IType)}.
   */
  public void test_getSingleModule_IType() throws Exception {
    IType entryPointType = m_testProject.getJavaProject().findType("test.client.Module");
    assertModuleDescriptionPath("src/test/Module.gwt.xml", Utils.getSingleModule(entryPointType));
  }
View Full Code Here

      assertTrue(resource.exists());
      assertFalse(Utils.isRemoteService(resource));
    }
    // new RemoteService
    {
      IType type = GTestUtils.createTestService(this)[0];
      IResource resource = type.getUnderlyingResource();
      assertThat(resource).isInstanceOf(IFile.class);
      assertTrue(resource.exists());
      assertTrue(Utils.isRemoteService(resource));
    }
  }
View Full Code Here

      IJavaElement element = javaProject.findType("test.client.Module");
      assertFalse(Utils.isRemoteServiceImpl(element));
    }
    // new RemoteService impl
    {
      IType element = GTestUtils.createTestService(this)[1];
      // type itself is RemoteService impl
      assertTrue(Utils.isRemoteServiceImpl(element));
      // ...and enclosing IType too
      assertTrue(Utils.isRemoteServiceImpl(element.getCompilationUnit()));
    }
  }
View Full Code Here

      IJavaElement element = javaProject.findType("test.client.Module");
      assertTrue(Utils.isEntryPoint(element));
    }
    // RemoteService impl is NOT EntryPoint
    {
      IType element = GTestUtils.createTestService(this)[0];
      assertFalse(Utils.isEntryPoint(element));
    }
  }
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for {@link Utils#parseUnit(ICompilationUnit)}.
   */
  public void test_parseUnit() throws Exception {
    IType type = m_testProject.getJavaProject().findType("test.client.Module");
    CompilationUnit compilationUnit = Utils.parseUnit(type.getCompilationUnit());
    assertNotNull(compilationUnit);
    assertEquals("Module", DomGenerics.types(compilationUnit).get(0).getName().getIdentifier());
  }
View Full Code Here

    browse.setText(browseButtonLabel);
    GridData data3 = new GridData(GridData.FILL_HORIZONTAL);
    browse.setLayoutData(data3);
    browse.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        IType baseType;
        try {
          baseType = getPackageFragmentRoot().getJavaProject().findType(
              baseClassName);

          // edit this to limit the scope
          SelectionDialog dialog = JavaUI.createTypeDialog(
              composite.getShell(), new ProgressMonitorDialog(composite
                  .getShell()), SearchEngine.createHierarchyScope(baseType),
              IJavaElementSearchConstants.CONSIDER_CLASSES, false);

          dialog.setMessage("&Choose a type:");
          dialog.setBlockOnOpen(true);
          dialog.setTitle(dialogTitle);
          dialog.open();

          if ((dialog.getReturnCode() == Window.OK)
              && (dialog.getResult().length > 0)) {
            IType type = (IType) dialog.getResult()[0];
            text.setText(type.getFullyQualifiedName());
          }
        } catch (JavaModelException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
View Full Code Here

    try {
      IJavaProject project = (IJavaProject) resource.getProject().getNature(
          JavaCore.NATURE_ID); // todo(jz)
      // check this is the case before letting this method get called
      Object element = resource.getAdapter(IJavaElement.class);
      IType type = ((ICompilationUnit) element).findPrimaryType();
      jarrer.setManifestMainClass(type);
      path = new Path(new File(Activator.getDefault().getStateLocation()
          .toFile(), resource.getProject().getName() + "_project_hadoop_"
          + resource.getName() + "_" + System.currentTimeMillis() + ".jar")
          .getAbsolutePath());
View Full Code Here

                programArguments.add("-test"); //$NON-NLS-1$
                programArguments.add(method.getDeclaringType().getFullyQualifiedName() + ':' + method.getElementName());
            }
            else if (testElements[0] instanceof IType)
            {
                IType type = (IType) testElements[0];
                programArguments.add("-classNames"); //$NON-NLS-1$
                programArguments.add(type.getFullyQualifiedName());
            }
            else
            {
                abort(JUnitMessages.JUnitLaunchConfigurationDelegate_error_wrong_input, null, IJavaLaunchConfigurationConstants.ERR_UNSPECIFIED_MAIN_TYPE);
            }
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.