views:

111

answers:

1

Motivation

I have written an eclipse plugin that shows me a list of all files and folders with unreviewed content. When selecting a folder, I want an editor to open showing all files and subfolders that this folder contains. It has to work for versioned items, too. So I have to create the content of the editor within my plugin (no backing IResource).

What I currently have

Right now I'm opening a RemoteFileEditorInput for a versioned file (subclipse) or I'm using IWorkbenchPage.openEditor() for a FileEditorInput.

Question

What's an easy way to visualize dynamic content (directory listing) inside of an text editor?

EDIT 2010-04-13:

More Context

I want to be able to create some code review comments on a directory listing. For this I want to be able to open a diff viewer to see which elements were removed or added between two revisions of the directory.

I'd like to enter a comment for a directory the same way I do for a text file. That's why I try to display the directory content as a text file - I've already implemented the mechanisms for commenting a text file.

I call the content of the directory editor "dynamic", because it's not really backed by an existing directory in the filesystem. For older versions of a directory I will create the editor content within my program code.

A: 

I'm afraid I don't totally understand your question (and I lack the rep to comment on it).

Is this right?: You want to be able to open one of three editors in support of your goal:

  • An editor for unversioned files (you say you have this)
  • An editor for versioned files (you say you have this)
  • An editor for directories (this is what you need?)
    • What does the user do here? What does it look like?

I'm confused by "What's an easy way to visualize dynamic content (directory listing) inside of an text editor?"

Knowing that I probably completely miss your point, I would note that your editor can contain whatever controls you want it to (cf. some of the "forms" editors in PDE, like for editing a plug-in manifest) - you'd probably extend EditorPart, maybe create a ManagedForm in your createPartControl(), create a ListViewer, TableViewer, or TreeViewer in there, give it an appropriate content provider, and give it an appropriate label provider.

I'm also confused by "What's an easy way to visualize dynamic content (directory listing) inside of an text editor?"

I can only assume that you want to somehow poll or listen to some events and tell your viewer to update() or refresh().

Finally I would question whether the directory listing really belongs in an editor . . . most navigation happens in views. Will the user actually be performing edits to the directory somehow, and possibly "saving" them at some later time?

I hope this helps us all narrow down into whatever will help you.

Woody Zenfell III
Thanks for your reply. I added a section to my question to answer your questions.
tangens