StructuredModelManager [message #202898] |
Tue, 23 October 2007 08:48  |
Eclipse User |
|
|
|
Hello guys,
I have a question concerning the StructuredTextViewer. I'm using it to
display some piece of HTML. Since I only have the html in form of a
String, I put it into an ByteArrayStream and use this stream to load the
structured model. But I have to big problem.
1) Caching. The ModelManager seens to have some cache. How can I force it
to reload the model?
I have used teh fllowing approach:
structuredModel = modelManager.getModelForEdit("xxx.xxx.xxx.xxx",
inputStream, null);
modelManager.reinitialize(structuredModel);
But this does not solve the problem.
2) Internationalization. No matter how I convert the Stream (UTF-8, ...)
chinse characters are broken every time. Does anybody know how to solve
this issue?
Kind Regards,
Klaus
|
|
|
|
|
|
|
|
Re: StructuredModelManager [message #203418 is a reply to message #203378] |
Thu, 01 November 2007 01:56  |
Eclipse User |
|
|
|
Nitin Dahyabhai wrote:
> Klaus Schaefers wrote:
>> Hi, I have changed to way the model is handled now in the way you
>> suggested. This works fine, but now the html content assitant fails
>> Here is the stacktrace. What have I done wrong.
>>
>>
>> java.lang.IllegalStateException: problem getting model
>> at
>> org.eclipse.wst.xml.ui.internal.contentassist.AbstractConten tAssistProcessor.computeCompletionProposals(AbstractContentA ssistProcessor.java:1283)
>
>
> Nothing, content assist requires a managed model so it can go from the
> source viewer's document to that model.
Just to followup on this, you'd want to go back to the original
method you posted about since the model is shared in that case.
You can try using IStructuredModel.reload(InputStream), or just set
the text into the document as indicated previously.
--
Nitin Dahyabhai
Structured Source Editing
|
|
|
Powered by
FUDForum. Page generated in 0.08181 seconds