Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » How to add file to project?
How to add file to project? [message #74158] Sun, 29 June 2008 06:16 Go to next message
Eclipse User
Originally posted by: billiam.gmail.com

Hi,

This sounds like a very simple question, but I've searched the forum and
the web and haven't been able to find an answer.

I just installed PDT
( http://mirrors.xmission.com/eclipse/tools/pdt/downloads/drop s/S20080601-RC2/all-in-one/pdt-all-in-one-S20080601_RC2-linu x-gtk.tar.gz)
and created a new project. I have an existing code base that I'd like to
be able to view and edit in Eclipse. I cannot figure out how add these
files to the project.

What I've tried.

1) File->Import->General->File System
This apparently moves existing files into the workspace. I don't want to
make copies of files, I want to edit them how they currently exist in the
file system.

2) Opening files directly in the editor.
This works, but doesn't add the files to the PHP Explorer window. I
suppose I could have all the files open at once, but this seems suboptimal.

3) Changing the include paths in the project settings.
This gave me a nice tree view of my files, but didn't change the
Constants, Functions or Classes in the PHP Project Outline. It was unclear
whether "include paths" referred to project include paths for PDT or
somehow references PHP's include paths.

Again, I'd like to add existing files, without moving these files, to the
current PDT/Eclipse project.

Thanks.
Re: How to add file to project? [message #74211 is a reply to message #74158] Mon, 30 June 2008 05:32 Go to previous messageGo to next message
Eclipse User
Originally posted by: stoyan.dimitrov.homelan.bg

Hi,

Use these steps:
1. File > New > PHP Project
2. Name the project
3. Uncheck 'Use default' and browse to the folder where you files reside.
4. Hit Finish
5. In the showed dialog choose the first 'Create project in
[your-folder-here]' and confirm

Stoyan

Bill wrote:
> Hi,
>
> This sounds like a very simple question, but I've searched the forum and
> the web and haven't been able to find an answer.
> I just installed PDT
> ( http://mirrors.xmission.com/eclipse/tools/pdt/downloads/drop s/S20080601-RC2/all-in-one/pdt-all-in-one-S20080601_RC2-linu x-gtk.tar.gz)
> and created a new project. I have an existing code base that I'd like to
> be able to view and edit in Eclipse. I cannot figure out how add these
> files to the project.
>
> What I've tried.
>
> 1) File->Import->General->File System
> This apparently moves existing files into the workspace. I don't want to
> make copies of files, I want to edit them how they currently exist in
> the file system.
>
> 2) Opening files directly in the editor.
> This works, but doesn't add the files to the PHP Explorer window. I
> suppose I could have all the files open at once, but this seems suboptimal.
>
> 3) Changing the include paths in the project settings.
> This gave me a nice tree view of my files, but didn't change the
> Constants, Functions or Classes in the PHP Project Outline. It was
> unclear whether "include paths" referred to project include paths for
> PDT or somehow references PHP's include paths.
>
> Again, I'd like to add existing files, without moving these files, to
> the current PDT/Eclipse project.
> Thanks.
>
Re: How to add file to project? [message #74280 is a reply to message #74211] Mon, 30 June 2008 16:03 Go to previous messageGo to next message
Eclipse User
Originally posted by: billiam.gmail.com

That worked, thanks. I didn't realize the project directory should contain
all the PHP files (I thought it was only where settings, etc were stored).
Re: How to add file to project? [message #74710 is a reply to message #74158] Wed, 02 July 2008 04:22 Go to previous messageGo to next message
Eclipse User
Originally posted by: codeslave.ca.ibm.com

If you have an existing project (without PDT nature/builder in its
..project file) you can add that information manually.

http://wiki.eclipse.org/PDT/FAQ#How_do_I_convert_an_existing _project_to_use_PDT.3F

This works too if your project is not located in the workspace, since
you can File > Import > Existing Project and simply tell Eclipse to use
that other location for the project... once the project has a proper
..project file in it.

Or, if you've created a new PDT project, you can simply copy the files
into it.

You might also want to vote for
https://bugs.eclipse.org/bugs/show_bug.cgi?id=161760.

Nick

Bill wrote:
> Hi,
>
> This sounds like a very simple question, but I've searched the forum and
> the web and haven't been able to find an answer.
> I just installed PDT
>
( http://mirrors.xmission.com/eclipse/tools/pdt/downloads/drop s/S20080601-RC2/all-in-one/pdt-all-in-one-S20080601_RC2-linu x-gtk.tar.gz)

> and created a new project. I have an existing code base that I'd like to
> be able to view and edit in Eclipse. I cannot figure out how add these
> files to the project.
>
> What I've tried.
>
> 1) File->Import->General->File System
> This apparently moves existing files into the workspace. I don't want to
> make copies of files, I want to edit them how they currently exist in
> the file system.
>
> 2) Opening files directly in the editor.
> This works, but doesn't add the files to the PHP Explorer window. I
> suppose I could have all the files open at once, but this seems
suboptimal.
>
> 3) Changing the include paths in the project settings.
> This gave me a nice tree view of my files, but didn't change the
> Constants, Functions or Classes in the PHP Project Outline. It was
> unclear whether "include paths" referred to project include paths for
> PDT or somehow references PHP's include paths.
>
> Again, I'd like to add existing files, without moving these files, to
> the current PDT/Eclipse project.
> Thanks.
>

--
Nick Boldt :: Release Engineer, IBM Toronto Lab
Eclipse Modeling :: http://www.eclipse.org/modeling
http://wiki.eclipse.org/index.php/User:Nickb
Re: How to add file to project? [message #75646 is a reply to message #74211] Fri, 11 July 2008 05:25 Go to previous messageGo to next message
Eclipse User
Originally posted by: lists.cmsws.com

I have a similar problem. I did find the option to add files to the
project.

My problem comes at the point at which I tell it to add the file(s).

I started the "add these files to my project" part of the bit at 4pm
today. It is 10:30pm and it still has not finished adding all the files
to the project. I have about 9.5mb of files that need to be added. Does
this thing process all the files and analyze them to make sure it knows
all the details about the file(s)?

Why has it taken 6.5 hrs and is still not done?
Re: How to add file to project? [message #1000702 is a reply to message #74158] Tue, 15 January 2013 09:40 Go to previous message
Moti Bartov is currently offline Moti Bartov
Messages: 1
Registered: January 2013
Junior Member
Well, you can add/import a file into your project.
However, there is a little diffrences when you do this on a PC or on a Mac.

Let say you have an existing project and you want to add a source code file which you created on different environment?

On PC, what you need to do is.
1. Close Eclipse
2. Copy the file that you want to add to your project and place it in the project directory in the workspace.
3. Open Eclipse, look into the project directory tree, the file should be there now.

On Mac:
1. Close Eclipse
2. Copy the file that you want to add your project and place it in the project dir in the workspace
3. Open Eclipse, now, on the prject directory, if you expand it the file still dosn't showed.. (as did happend on PC)
4. Right click on the prject directory and select Refresh! The file should be added to the project.

Regards,
Moti.

Previous Topic:how to use WSDL editor in Indigo
Next Topic:Helios does'nt stops on breakpoints
Goto Forum:
  


Current Time: Fri Oct 24 07:15:33 GMT 2014

Powered by FUDForum. Page generated in 0.04869 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software