[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.rcp] Re: Reuse the navigation view in RCP

I had a need to do a similar view, I could have taken the navigator/outline view, but dropped the idea.

I find this a simpler solution:

public class MyTreeView extends ViewPart {

//=========================================
  class MyTreeViewContentProvider implements ITreeContentProvider {

  }
//=========================================
  public class MyTreeViewLabelProvider extends LabelProvider {
  }

//=========================================
public void createPartControl(Composite parent) {
this.treeViewer = new TreeViewer( parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL );
this.drillDownAdapter = new DrillDownAdapter( this.treeViewer );


    // set controller
    this.treeViewer.setContentProvider( new MyreeViewContentProvider( ) );
    this.treeViewer.setLabelProvider( new MyTreeViewLabelProvider( ) );

    // publishes events
    getSite( ).setSelectionProvider( this.workflowTreeViewer );

    // set the input
    this.workflowTreeViewer.setInput( someDirectoryObject );
  }
}



Dan Phifer wrote:
Hi, I've started with the "Hello World!" RCP template in 3.1M7. I would like to re-use the navigation view provided in eclipse, but I'm not sure how to do this. Basically, I would just like to be able to browse and open files in the current directory. How can I do this without re-wrinting the Navigator view functionality?

Dan


-- Ketan Padegaonkar http://KetanPadegaonkar.blogspot.com

	A master programmer passed a novice programmer one
day.  The master noted the novice's preoccupation with
a hand-held computer game.  "Excuse me", he said, "may I
examine it?"
	The novice bolted to attention and handed the
device to the master.  "I see that the device claims to
have three levels of play: Easy, Medium, and Hard", said
the master.  "Yet every such device has another level of
play, where the device seeks not to conquer the human,
nor to be conquered by the human."
	"Pray, great master," implored the novice, "how
does one find this mysterious setting?"
	The master dropped the device to the ground and
crushed it under foot.	And suddenly the novice was
enlightened.
		-- Geoffrey James, "The Tao of Programming"