Encountered an NullPointException with StructuredModelManager [message #230471] |
Thu, 16 April 2009 22:16 |
Frank Du Messages: 91 Registered: July 2009 |
Member |
|
|
Dear, All,
Again, we are reading/writing in-memory objects. A disk file will be
parsed into model, and the SSE editor will display a small portion of the
model.
I implemented the IStorageEditorInput and IStorage for the objects. Then
added required plug-ins to the launch settings. But I kept encountering
NullPointException when trying to open a file. The debug showed that in
the following lines, model is a null value.
Do we need to register a model? If yes, how to register a model?
//org.eclipse.wst.sse.ui.internal.StorageModelProvider
//......
// first parameter must be unique
model = StructuredModelManager.getModelManager().getModelForEdit(id,
contents, null);
model.setBaseLocation(calculateBaseLocation(input));
Supplementary:
If the program starts with all the plug-ins, the problem is gone. It seems
that some plug-in contributes models for the issue. Is there a way to
figure out the plug-in?
Thank you so much!
Have a nice day!
Frank
|
|
|
Re: Encountered an NullPointException with StructuredModelManager [message #230494 is a reply to message #230471] |
Sat, 18 April 2009 01:02 |
|
Frank Du wrote:
> Dear, All,
>
> Again, we are reading/writing in-memory objects. A disk file will be
> parsed into model, and the SSE editor will display a small portion of
> the model.
> I implemented the IStorageEditorInput and IStorage for the objects. Then
> added required plug-ins to the launch settings. But I kept encountering
> NullPointException when trying to open a file. The debug showed that in
> the following lines, model is a null value.
> Do we need to register a model? If yes, how to register a model?
> //org.eclipse.wst.sse.ui.internal.StorageModelProvider
> //......
> // first parameter must be unique
> model = StructuredModelManager.getModelManager().getModelForEdit(id,
> contents, null);
> model.setBaseLocation(calculateBaseLocation(input));
>
>
> Supplementary:
> If the program starts with all the plug-ins, the problem is gone. It
> seems that some plug-in contributes models for the issue. Is there a way
> to figure out the plug-in?
>
> Thank you so much!
It depends on what kind of input you're using, i.e. is it XML, HTML,
CSS, etc.? You'll need to have the language-specific UI and Core
plug-ins present as well as org.eclipse.wst.sse.ui and
org.eclipse.wst.sse.core. It also helps if the ID you're passing in
looks like an expected filename for your supported content type.
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Powered by
FUDForum. Page generated in 0.03444 seconds