| Summary: | [WorkingSets] Share WorkingSets between Workspaces | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Adam Wehner <adam.lucarz> | ||||
| Component: | IDE | Assignee: | Platform UI Triaged <platform-ui-triaged> | ||||
| Status: | NEW --- | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | prakash | ||||
| Version: | 3.6.2 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows Vista | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Adam Wehner
Created attachment 198533 [details]
Patch for sharing working sets definition by user.
Will investigate Okay, that does not work properly, because not existing projects are deleted from a working set definition. So when you switch between workspaces, these projects disappear from the working sets. I will have another look on that. Meanwhile..any ideas how to disable this behavior? Okay. I don't have a clue how to avoid the project disappear effect when working with different workspaces without changing the whole working sets definition read and write mechanism. So, I would request this feature here without providing a solution. Sorry for that. Instead of using a system property, there's an OSGi location service that will provide the equivalent of the plugin state location.
For example, a plugin state location is found using the following an appending the plugin id to the end of the path:
public Location getInstanceLocation() {
if (locationTracker == null) {
Filter filter = null;
try {
filter = context.createFilter(Location.INSTANCE_FILTER);
} catch (InvalidSyntaxException e) {
// ignore this. It should never happen as we have tested the
// above format.
}
locationTracker = new ServiceTracker(context, filter, null);
locationTracker.open();
}
return (Location) locationTracker.getService();
}
You could use org.eclipse.osgi.service.datalocation.Location.CONFIGURATION_FILTER instead of INSTANCE_FILTER. The configuration location is per-user in the case where the eclipse install is read-only. The append the plugin id to the path, similar to the following:
File baseLocation;
try {
baseLocation = new File(URIUtil.toURI(instanceLocation.getURL()));
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
baseLocation = new File(baseLocation, ".metadata"); //$NON-NLS-1$
baseLocation = new File(baseLocation, ".plugins"); //$NON-NLS-1$
baseLocation = new File(baseLocation, "org.eclipse.e4.workbench"); //$NON-NLS-1$
PW
|