|
Re: Create TreeViewer using Workspace Content [message #989141 is a reply to message #989063] |
Tue, 04 December 2012 19:14 |
John Steele Messages: 50 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 19:16] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04294 seconds