Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » CommonNavigator with large files
CommonNavigator with large files [message #328362] Fri, 23 May 2008 09:55 Go to next message
Eclipse UserFriend
Hi,

I have some large files I'd like to expand in CommonNavigator, and since
parse takes quite a while I naturally don't want to duplicate this parse
in the editor. Could someone recommend a way where I can only parse
once, and use the same parsed model in my Editor as in my
ContentProvider for the Navigator? Where should this model be placed?

Thanks,

/Ola
Re: CommonNavigator with large files [message #328400 is a reply to message #328362] Fri, 23 May 2008 22:34 Go to previous messageGo to next message
David Kyle is currently offline David KyleFriend
Messages: 125
Registered: July 2009
Senior Member
Ola,

I haven't implemented what you are looking to do but I would suggest looking
at the IDocumentProvider API. Your editor uses it and I don't see why you
couldn't get the Common Navigator to use it. I'm assuming your file is
opened as an IDocument.

Check out how
DocumentProviderRegistry.getDefault().getDocumentProvider(IE ditorInput)
works.

I was thinking of doing this but our files are too massive to expand in the
Common Navigator. We consider a 1 Gigabyte file to be very small.

David Kyle
http://richclientplatform.blogspot.com/
Re: CommonNavigator with large files [message #328581 is a reply to message #328362] Tue, 27 May 2008 21:25 Go to previous message
Francis Upton IV is currently offline Francis Upton IVFriend
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
The navigators work with resources, how you manage the models is your
own affair. In my application, I keep a hash from the IFile to my model
object so I will find the open file if it's already in memory.

In my editor, I have some code like this:

@Override
public void init(IEditorSite site, IEditorInput input)
throws PartInitException
{
IFile file;

if (input instanceof IFileEditorInput)
{
file = ((IFileEditorInput)input).getFile();
_mainNode = _editor.getRuntime().findMainNode(file);
}

You can see that last method looks up the file.

HTH,

Francis


Ola Spjuth wrote:
> Hi,
>
> I have some large files I'd like to expand in CommonNavigator, and since
> parse takes quite a while I naturally don't want to duplicate this parse
> in the editor. Could someone recommend a way where I can only parse
> once, and use the same parsed model in my Editor as in my
> ContentProvider for the Navigator? Where should this model be placed?
>
> Thanks,
>
> /Ola


Previous Topic:Sharing Object between Viewparts
Next Topic:Project icon missing in navigator view problem
Goto Forum:
  


Current Time: Sat Jul 27 12:33:21 GMT 2024

Powered by FUDForum. Page generated in 0.06770 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top