|
| Re: Create TreeViewer using Workspace Content [message #989141 is a reply to message #989063] |
Tue, 04 December 2012 14:14   |
John Steele Messages: 42 Registered: January 2010 |
Member |
|
|
Get the workspace root:
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
Get the projects:
IProject [] projects = root.getProjects()
viewer.setInput(projects)
Create your viewer, content provider, and label provider. You can set the input to the viewer as the array of projects or the workspace root.
Your content/label provider will need to use instanceof to determine the type of object you are currently working with, cast it, then return the respective property value.
You could also check out the common navigator framework.
[Updated on: Tue, 04 December 2012 14:16] Report message to a moderator
|
|
|
|
| Re: Create TreeViewer using Workspace Content [message #989798 is a reply to message #989347] |
Fri, 07 December 2012 15:53  |
John Steele Messages: 42 Registered: January 2010 |
Member |
|
|
You will need to add the resources bundle to the project's dependencies list. As well to the launch configuration, along with it's dependencies.
You can get the workspace location by calling:
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
root.getLocation()
In RCP, you can get the default location by calling:
Platform.getLocation() or Platform.getInstanceLocation().
You can change the default location by specifying the -data or osgi.instance.area system propery.
Happy hunting.
|
|
|
Powered by
FUDForum. Page generated in 0.01560 seconds