CommonNavigator with large files [message #328362] |
Fri, 23 May 2008 05:55  |
Eclipse User |
|
|
|
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 #328581 is a reply to message #328362] |
Tue, 27 May 2008 17:25  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03855 seconds