Suzan Cioc
Suzan Cioc

Reputation: 30097

Better workspace location for Eclipse RCP projects

I don't understand, what workspace is, for example, if I am writing text editor application.

But I am regarding it as some unavoidable concept of Eclipse RCP platform, which serves as a storage for application-scope data.

Thinking so, I wonder wouldn't it be better to reconfigure default workspace location?

Current default location is

${workspace_loc}/../runtime-

and it is said Append launch configuration name to this location.

May be it is better just to set Use as workspace location and set

${project_loc}/workspace

?

This way each project will be on it's own.

UPDATE

I know XMind program is written with RCP. This is normal document-oriented application.

Where is workspace in it?

Upvotes: 0

Views: 756

Answers (2)

Bananeweizen
Bananeweizen

Reputation: 22070

Your initial assumption is wrong. Eclipse RCP applications can be implemented without using the workspace at all. There are popular examples like the feed reader RSSOwl.

Everything in the Eclipse eco-system is made of plugins. If your application does not use the org.eclipse.core.resources plugin, then there is no workspace in your application.

Your next misconception is about the workspace location. In the launch configuration settings Eclipse will create that "runtime-"... workspace, but that is only for testing. If you later export that RCP application, it will have a completely different default location of course, and it will also ask you for location on startup, just as your Eclipse development IDE does. So configuring anything different in the launch configuration does not change the behaviour of the application which you deploy later.

Upvotes: 0

Chandrayya G K
Chandrayya G K

Reputation: 8849

About workspace:

See the help content from Eclipse menu Help->Help Contents. Navigate to Platform Plug-in Developer Guide > Programmer's Guide > Welcome to Eclipse ,Platform Plug-in Developer Guide > Programmer's Guide > Resources overview and Platform Plug-in Developer Guide > Programmer's Guide > Resources overview

You may not need to know much about the workspace and the APIs related to it to develop your application/product unless your not handling any preferences,resources and files navigator.

During development of you application you have to keep and organise your source code, conf files and resources some where on the file system. This is called the workspace.

On a given workspace you can open only one instance of Eclipse and you can open multiple instances of eclipse on different workspaces.

Note that the workspace location of your eclipse application and the workspace location of your eclipse itself are different.

Each workspace has a hidden folder called .metadata where the all plug-ins preferences are stored.

Clarification:

You can change this location to any other path like c:/mytexteditor or /home/<username>/mytexteditor etc. May not append the project name.

You may use the location ${project_loc}/workspace as your application workspace location. But if you do so a folder called workspace will be created inside the project itself then,

  1. You may delete/modify this folder accidentally while debugging your application.
  2. In case you are exporting this project you need to deselect this folder
  3. Add a filter to avoid committing the resources under this folder into source code repository.

Because of these reasons(and many other) its better to keep the workspace location of your eclipse and eclipse application different.

Upvotes: 1

Related Questions