Package org.eclipse.jdt.core

Examples of org.eclipse.jdt.core.IJavaProject


                {
                    @Override
                    protected void execute(IProgressMonitor monitor) throws CoreException
                    {
                        SigilCore.makeSigilProject(project, monitor);
                        IJavaProject java = JavaCore.create(project);
                        ISigilProjectModel sigil = SigilCore.create(project);
                        String bsn = project.getName();
                        sigil.getBundle().getBundleInfo().setSymbolicName(bsn);

                        IClasspathEntry[] entries = java.getRawClasspath();
                        for (int i = 0; i < entries.length; i++)
                        {
                            IClasspathEntry entry = entries[i];
                            if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE)
                            {
View Full Code Here


        ISigilProjectModel sp = bundle.getAncestor(ISigilProjectModel.class);

        if (sp != null)
        {
            IJavaProject p = sp.getJavaModel();

            for (String enc : bundle.getClasspathEntrys())
            {
                IClasspathEntry e = p.decodeClasspathEntry(enc);
                if (e != null)
                {
                    cp.add(e);
                }
            }
View Full Code Here

    public static Collection<ICompilationUnit> findCompilationUnits(
        ISigilProjectModel project) throws JavaModelException
    {
        LinkedList<ICompilationUnit> ret = new LinkedList<ICompilationUnit>();

        IJavaProject java = project.getJavaModel();
        for (IClasspathEntry cp : findClasspathEntries(project.getBundle()))
        {
            IPackageFragmentRoot[] roots = java.findPackageFragmentRoots(cp);
            for (IPackageFragmentRoot rt : roots)
            {
                for (IJavaElement j : rt.getChildren())
                {
                    IPackageFragment p = (IPackageFragment) j;
View Full Code Here

        // Find imports from Java source
        Job findImportsJob = new Job("Find imports")
        {
            protected IStatus run(IProgressMonitor monitor)
            {
                IJavaProject javaProject = getProjectModel().getJavaModel();
                try
                {
                    IPackageFragment[] packages = javaProject.getPackageFragments();
                    for (IPackageFragment pkg : packages)
                    {
                        ICompilationUnit[] compilationUnits = pkg.getCompilationUnits();
                        for (ICompilationUnit compilationUnit : compilationUnits)
                        {
View Full Code Here

        IProject project = manifest.getProject();

        Logger pluginLogger = Activator.getDefault().getPluginLogger();

        IJavaProject javaProject = ProjectHelper.asJavaProject(project);

        IFolder outputFolder = (IFolder) project.getWorkspace().getRoot().findMember(javaProject.getOutputLocation());

        if (!outputFolder.getFullPath().isPrefixOf(manifest.getFullPath())) {
            pluginLogger.trace("Ignoring manifest found at {0} since it is not under the output directory at {1}",
                    manifest.getFullPath(), outputFolder.getFullPath());
            return Collections.emptyList();
View Full Code Here

                "org.eclipse.jdt.launching.sourceLookup.javaSourcePathComputer")); //$NON-NLS-1$
    List<ISourceContainer> l = new LinkedList<ISourceContainer>();
    IJavaProject[] javaProjects = ProjectHelper.getAllJavaProjects();
    if (javaProjects!=null) {
      for (int i = 0; i < javaProjects.length; i++) {
        IJavaProject javaProject = javaProjects[i];
        JavaProjectSourceContainer sc = new JavaProjectSourceContainer(javaProject);
        l.add(sc);
//          ISourceContainer[] scs = sc.getSourceContainers();
//          if (scs!=null && scs.length>0) {
//            for (int j = 0; j < scs.length; j++) {
View Full Code Here

         * behaviour is used where only diffs are published, this members might have
         * to return exactly the opposite: everything derived..)
         */
        @Override
        public IModuleResource[] members() throws CoreException {
            final IJavaProject javaProject = ProjectHelper.asJavaProject(getProject());
            final List<IModuleResource> resources = new ArrayList<IModuleResource>();
           
            final Set<String> filteredLocations = new HashSet<String>();

            final IJavaProject jp = javaProject;
            final IClasspathEntry[] rawCp = jp.getRawClasspath();
            for (int i = 0; i < rawCp.length; i++) {
        IClasspathEntry aCp = rawCp[i];
        IPath outputLocation = aCp.getOutputLocation();
        if (outputLocation!=null) {
                    outputLocation = outputLocation.makeRelativeTo(getProject().getFullPath());
View Full Code Here

        if (forceResolve) {
            processRequirementsChanges(monitor);
        }
       
        Path containerPath = new Path(SigilCore.CLASSPATH_CONTAINER_PATH);
        IJavaProject java = getJavaModel();
        ClasspathContainerInitializer init = JavaCore.getClasspathContainerInitializer(SigilCore.CLASSPATH_CONTAINER_PATH);
        ThreadProgressMonitor.setProgressMonitor(monitor);
        try
        {
            init.requestClasspathContainerUpdate(containerPath, java, null);
View Full Code Here

        {
            dynamic = new HashSet<IRuntimeClasspathEntry>();
            dynamicRuntime.put(config, dynamic);
        }

        IJavaProject javaProject = project.getJavaModel();
        IRuntimeClasspathEntry cp = JavaRuntime.newProjectRuntimeClasspathEntry(javaProject);

        dynamic.add(cp);
    }
View Full Code Here

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
    EditorHelper editor = EditorHelper.getCurrent(event);
    IProject project = editor.getProject();
    IJavaProject jProject = JavaCore.create(project);
   
    if(editor != null) {
      String relativePath = ((IFileEditorInput) editor.textEditor.getEditorInput()).getFile().getProjectRelativePath().toString();
      if (relativePath.startsWith("app/japidviews/") && relativePath.endsWith(".java")) {
        // bran: if we are in the japid derived Java template code, let's switch back to the html view
        String jFile = DirUtil.mapJavaToSrc(relativePath);
        IFile f = project.getFile(jFile);
        try {
          FilesAccess.openFile(f);
        } catch (CoreException e) {
          PlayPlugin.showError(e);
        }
        return null;   
      }
    }
   
    boolean useJapid = true;

    String line;
    String viewName = null;
    String title = editor.getTitle();
    String controllerName = title.replace(".java", "");

    String packageName = "";
    IEditorInput editorInput = editor.textEditor.getEditorInput();
   
    ITextSelection selection = (ITextSelection) editor.textEditor.getSelectionProvider().getSelection();
    IJavaElement elem = JavaUI.getEditorInputJavaElement(editorInput);
    ICompilationUnit unit = null;
    if (elem instanceof ICompilationUnit) {
      unit = (ICompilationUnit) elem;
      try {
        IPackageDeclaration[] packs = unit.getPackageDeclarations();
        if (packs.length < 1) {
          info("This action can only apply to controllers.");
          return null;
        } else {
          packageName = packs[0].getElementName();
          if (!packageName.startsWith("controllers")) {
            info("This action can only apply to controllers.");
            return null;
          }
        }
       
        // get the class declaration line
        IType type = unit.getType(controllerName);
        ITypeHierarchy superTypes = type.newSupertypeHierarchy(null);
//        String name = JapidController.class.getName(); // this will require play.jar
        String name = "cn.bran.play.JapidController";
        IType japidController = jProject.findType(name);
        if (superTypes.contains(japidController)) {
          useJapid = true;
        }
        else {
          useJapid = false;
View Full Code Here

TOP

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

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.