IDocument.replace(...) don't work with lpex [message #22404] |
Wed, 20 March 2002 15:25 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: c.tucholski.avkseg.com
>Repost this on the eclipse.tools.cdt newsgroup. The LPEX editor is
>part of the CDT and the lpex developer most likely watches that one
>more closely. It sounds like an lpex problem.
>
>Peter
Christian Tucholski wrote:
Hi,
I'm using the IDocument.replace(...) function to manipulate files. With
the java editor the function works correct. But it has no effect with
the lpex editor.
Is this a bug or a feature of eclipse? Or have I done something wrong?
Thanks
\\|//
(. .)
-oOOo-(w)-oOOo-
Christian
|
|
|
|
Re: IDocument.replace(...) don't work with lpex [message #22537 is a reply to message #22448] |
Thu, 21 March 2002 13:28 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: c.tucholski.avkseg.com
Hi Adrian,
the goal is to insert some text components into the active editor to the
cursor position. If I use special editor functions the program will be
editor dependent. For this case the replace() function is very pleasant
to use.
I'm working with the eclipse Build 20020125 and the CDT-Version R2-20020208,
regards,
\\|//
(. .)
-oOOo-(w)-oOOo-
Christian
adrian wrote:
> Christian,
>
> In general, in LPEX you should try to use its own functions, rather than
> Eclipse's. LPEX's versions of TextViewer, SourceViewer, etc. are *partial*
> implementations of Eclipse's. What are you trying to do?
>
> I'm currently adding the handling of documentChanged(DocumentEvent) in
> LpexTextViewer, in order to handle correctly the replacing of an open file
> with a copy from the local history. This fix will probably fix your
> problem too.
>
> Which version of LPEX are you using (which Eclipse driver)? I can send you
> a patched driver when I'm finished.
>
> Christian Tucholski wrote:
>
>
>> >Repost this on the eclipse.tools.cdt newsgroup. The LPEX editor is
>> >part of the CDT and the lpex developer most likely watches that one
>> >more closely. It sounds like an lpex problem.
>> >
>> >Peter
>>
>>Christian Tucholski wrote:
>>
>>Hi,
>>
>>I'm using the IDocument.replace(...) function to manipulate files. With
>>the java editor the function works correct. But it has no effect with
>>the lpex editor.
>>
>>Is this a bug or a feature of eclipse? Or have I done something wrong?
>>
>>Thanks
>>
>> \\|//
>> (. .)
>>-oOOo-(w)-oOOo-
>> Christian
>>
>
|
|
|
|
|
Re: IDocument.replace(...) don't work with lpex [message #22751 is a reply to message #22707] |
Wed, 27 March 2002 08:45 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: c.tucholski.avkseg.com
Hi Brian,
I think I can live with this solution. It is nice to have this part
editor independent but it is not necessary. The behavior of lpex and
java are different (e.g. lpex don't like 'cr' (0xd) characters) that I
must anyhow distinguish the editors.
Regards,
\\|//
(. .)
-oOOo-(w)-oOOo-
Christian
Brian Thomson wrote:
> Christian, please open a Bugzilla enhancement request against the Lpex
> component if you have any issues with
> this answer. I think your desire to avoid editor-specific code in your
> plugin when you are invoking
> generic function is very reasonable.
>
> Brian
>
> adrian wrote:
>
>> This was successfully handled offline.
>>
>> LPEX doesn't keep stream-oriented IDocument up-to-date between saves,
>> so querying
>> / setting text should be done in LPEX directly:
>>
>> // <import plugin="com.ibm.lpex"/> in plugin.xml
>> import com.ibm.lpex.core.LpexView;
>> import com.ibm.lpex.alef.LpexTextEditor;
>> . . .
>> IEditorPart editor = IWorkbenchPage.getActiveEditor();
>>
>> // (a) Using LPEX
>> if (editor instanceof LpexTextEditor) {
>> LpexTextEditor lpexEditor = (LpexTextEditor)editor;
>> LpexView lpexView = lpexEditor.getLpexView();
>> if (lpexView != null) {
>> // insert my_string at the cursor;
>> // if the text passed to the insertText command contains new line
>> // characters ('\n'), new lines will be inserted into the document
>> lpexView.doDefaultCommand("insertText " + my_string);
>> // refresh the display
>> LpexView.doGlobalCommand("screenShow");
>> }
>> }
>>
>> // (b) Using an Eclipse editor
>> else {
>> . . .
>> }
>>
>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04446 seconds