How do workspaces work in Aptana 3? - eclipse

I'm new to programming and IDEs. I never understood the concept of a workspace in Eclipse, and I don't understand it in Aptana.
With Eclipse I just put it into my web root. Not sure if that's the way to go?
Can someone explain what a workspace is and where it should go? And if not in the web root, then how do I launch a PHP page from within the EDI?
Thanks!

An Eclipse workspace is a directory where (generally) all of the files you are working on live and that stores all of the state (like preferences and such) for a single user of Eclipse. So when you create projects, they are located in the workspace. The workspace has some metadata files that control how Eclipses behaves for you.
Eclipse keeps a representation of the workspace internally, which means the workspace can get out of sync with the underlying files. To sync them up, do a right-click Refresh in the Package/Project Explorer.
Usually the workspace goes into some directory relative to your home directory, since it's private to each developer.

Workspaces are like folders where the project's files are.
When you have a local web server you could set the workspace to a new folder in the servers directory (or web root when the project should be in the main directory!) . If you want to add a new PHP-file in Aptana studio 3 just right click the workspace and select add new file (or sth. like that). After that you will be able to enter a file-name and it's gonna be saved in the workspace (folder). But of course you can also work without workspaces, just create the the PHP-File and edit it with Aptana.

Related

what should keep in mind before providing work space for eclipse?

This is how the workspace assign on an eclipse
My Web project run only when my project is at c:\Ampps\www\myProject but eclipse contains it on C:\Simple\workspace\myProject. My problem is I want to run project and the workspace is different. What is the things keep in mind before choosing the workspace. And what are the alternatives if the wrong workspace choosen ?
Eclipse does not require your projects to live under your workspace folder. Therefore you are allowed to have a project and workspace as you describe.
When creating a project, uncheck the default location checkbox in the wizard and select your truly desired location.
My only recommendation on workspace location is to have it on a local drive and don't have it as a sub directory of any project in your workspace.

What is the runtime-EclipseApplication folder for, and can I delete it safely?

I'm trying to organise the directory structure of my projects' source code and the eclipse workspace etc.
I found a folder called runtime-EclipseApplication in a high level folder outside the directories where I keep my workspace and projects.
What is this folder, when/why is it created and is it safe to delete?
This is the default for the workspace name when you use Run As > Eclipse Application.
You can look in the Eclipse Applications section of the Run > Run Configurations dialog to see what (if anything) is using this workspace. The workspace name is shown in the Location field of the Main tab.

Does Eclipse store all workspace files somewhere else?

I'm often surprised that Eclipse is giving error during search "File is out of sync with file system", for the file that I have not even opened. I have a large workspace with hundreds of files under SVN control. I have configured Eclipse to "auto-refresh" on load to minimize such issues.
I can't stop wondering how can this happen at all? Why does it need to "refresh" if it should (at least I expect it to) just load everything from file system?
It looks like it's storing all the files somewhere (not even in memory, having a need to refresh on load), and if it's true - I don't like it.
Eclipse does not store your files anywhere except your workspace directory and does not use the file system directly every time when you need some files.
Eclipse indexes/caches different meta-information for all projects and theirs files in your workspace. The information can be found under .metadata folder of your workspace directory.
Such information is used to provide the tree of the files to the Eclipse and show resources in views such as Project Explorer, Package Explorer etc.
The main reason of such behaviour is performance purposes.
The out of sync problem appears when:
you create files manually (out of the Eclipse) in your workspace
Eclipse plugins or processes create/update/delete/etc. files improperly i.e. do not call related Eclipse API to refresh the resources and update the indexes.

common workspace setup in eclipse

I want to create several workspaces which point to different branches of a codebase.
The problem I am facing is every time I need to create a new workspace I have to do the same configuration for each workspace.
Example:
Setting up tomcat configuration and it's related java options such as library and java agent settings.
A system variable that points to specific folder containg my jar files.
Another system variable
Questions:
is it possible to have these setups done once so that all subsequent workspaces do not need to be configured?
is it possible to export these preferences and import later into any workspace either on my machine or other machine?
System information:
Windows 7, Eclipse 3.5, Sysdeo tomcat plugin, Tomcat 6
While eclipse does have an Export preferences option, it does not export everything and specifically it is not comprehensive enough for workspace duplication.
In the past I have had a lot of success just cloning the physical workspace folder itself.
For example, let's say you have setup the workspace with everything that you want in it. To duplicate it, find out the path of the current workspace folder by going to File -> Switch workspace -> Other. The path shown here in the dialogue that pops up is the current workspace path ( don't press ok yet)
Create a copy of this folder. Now to use this copy, just use it in the above dialogue, i.e., go to File -> Switch workspace -> Other and put in the path of the copy. Press OK and Eclipse shall restart with the new workspace. Now the only thing you will have to do is point the code to a different branch. Rest all the settings should be present already.
This works specially well on the same machine. If you copy this workspace folder it should still work but your mileage may vary.

How to move an eclipse (helios) project to a different workspace?

First, Eclipse is not my native IDE -- I'm barely a n00b with it. I set up a project in a workspace that was actually in the directory of another client's project (I didn't really follow the whole workspace/project thing) and, in fact, now I can't even find the Eclipse workspace file to open it.
What I'd like to do is:
Open my eclipse project (/workspace?) -- I know where all the files are on disk, just not what to open in order to see them in Eclipse -- and
Move my project to a new workspace, which I guess I will put in a generic Eclipse-y place, and have that one workspace reference all my Eclipse projects.
(Is that the right way to do it? Does Eclipse dislike me being a one-project == one-workspace kind of guy?)
Please educate me regarding The Eclipse Way so that I can get back to work writing code.
Thanks!
Roughly a workspace (which is a directory) in Eclipse contains:
configuration (installed JRE, Servers runtimes, code formatting rules, ...)
one or more projects
You can of course have as many workspaces as you want (but only one can be opened at a time) and a project can also be part of different workspaces.
If you know where your sources are and want to move them to a new workspace here is a possible solution:
Start Eclipse and when prompted for a workspace choose where you want the workspace to be created (if directory doesn't exist it will be created). For example you can choose C:/Dev/Workspace/.
If you are not prompted, go to File->Switch workspace->Other
Once you are in your workspace you can import your exisiting project with File->Import then General->Existing Projects into workspace
Navigate to the folder containing your project sources, select your project and click finish
I don't know if it's a best practice or not but what I usually do is the following:
I have one workspace for each of my customer (workspace_cust1, workspace_cust2)
Each workspace references my commons library projects and add client specific projects
This way each time I change my commons library it's up to date in every workspace.
If you want to apply
one workspace = one project
You could to the following:
1) Copy the eclipse desktop shorcut
2) Modify the shortcut by appending "-data workspaceLocation "