CommonNavigator with large files [message #328362] |
Fri, 23 May 2008 09: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 21:25 |
Francis Upton IV 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
Platform UI Committer for Common Navigator
http://wiki.eclipse.org/index.php/Common_Navigator_Framework
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/cnf.htm
|
|
|
Powered by
FUDForum. Page generated in 0.03156 seconds