Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-text-dev] line wrapping


Yes, you could. This way you'd circumvent any support available in the widget and avoid the problems I described.

When you want to have a solution that does not just work for a particular kind of document but for any document you would have to implement something like LineWrappingDocument (similar to Document) that works with a line wrapping line tracker and a text store forwarding all requests to a particular IDocument instance. The LineWrappingDocument would serve as the visible document of a text viewer whereas the IDocument instance would be the viewer's input document. This is also the scheme along which we implemented folding and segmented mode. The downside of this approach to line wrapping is that you'd duplicate code that is already available in SWT land.

Kai




zohar.melamed@xxxxxxxxxxxxxxxxx
Sent by: platform-text-dev-admin@xxxxxxxxxxx

10/01/2004 04:33 PM

Please respond to
platform-text-dev@xxxxxxxxxxx

To
platform-text-dev@xxxxxxxxxxx
cc
Subject
Re: [platform-text-dev] line wrapping






I have full control of the IDocument for which line wrapping is required.
Can I get this to work using a custom ILineTracker ?







Internet
kai-uwe_maetzel@xxxxxxxxxx@eclipse.org - 01/10/2004 12:01


Please respond to platform-text-dev@xxxxxxxxxxx

Sent by:    platform-text-dev-admin@xxxxxxxxxxx



To:    platform-text-dev

cc:


Subject:    Re: [platform-text-dev] line wrapping


Zohar,

The StyledText widget supports line wrapping. Line wrapping is not
considered in any layer higher up.  Thus, text viewers and text editors
are not aware of line wrapping.  However, because of the existing support
for folding and segmented views clients are supposed to never directly map
between widget coordinates and viewer coordinates. (Viewer or model
coordinates are those that are expressed in terms of character offsets of
the viewer's input document. In case of folding or segmented mode, the
visible document differs from the input document.) Clients should use the
ITextViewerExtension5 interface for conversion.  The text viewer itself
uses an IDocumentInformationMapping instance to implement the extension
interface. This all should make line wrapping work in most case already.
For displaying, problem areas are most likely to be found in the vertical
ruler columns such as the LineNumberRulerColumn and the
AnnotationRulerColumn and in the editor's status line item displaying the
caret coordinates. For interaction, problems will show up everywhere where
we expect a model line to match a displayed line. Among other these might
be: moving/copying lines, deleting/cutting lines, extending selection to
be a line selection, etc.

Kai

> I have been looking at adding a fixed column line wrapping to TextEditor
> but see no simple way of doing this.
>
> Any ideas ?
>
> Cheers
> Zohar

(See attached file: C.htm)

This message and any attachments (the "message") is
intended solely for the addressees and is confidential.
If you receive this message in error, please delete it and
immediately notify the sender. Any use not in accord with
its purpose, any dissemination or disclosure, either whole
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message.
BNP PARIBAS (and its subsidiaries) shall (will) not
therefore be liable for the message if modified.

**********************************************************************************************

BNP Paribas Private Bank London Branch is authorised
by CECEI & AMF and is regulated by the Financial Services
Authority for the conduct of its investment business in the
United Kingdom.

BNP Paribas Securities Services London Branch is authorised
by CECEI & AMF and is regulated by the Financial Services
Authority for the conduct of its investment business in the
United Kingdom.
 
BNP Paribas Fund Services UK Limited is authorised and
regulated by the Financial Services Authority.



Zohar,

The StyledText widget supports line wrapping. Line wrapping is not considered in any layer higher up.  Thus, text viewers and text editors are not aware of line wrapping.  However, because of the existing support for folding and segmented views clients are supposed to never directly map between widget coordinates and viewer coordinates. (Viewer or model coordinates are those that are expressed in terms of character offsets of the viewer's input document. In case of folding or segmented mode, the visible document differs from the input document.) Clients should use the ITextViewerExtension5 interface for conversion.  The text viewer itself uses an IDocumentInformationMapping instance to implement the extension interface. This all should make line wrapping work in most case already. For displaying, problem areas are most likely to be found in the vertical ruler columns such as the LineNumberRulerColumn and the AnnotationRulerColumn and in the editor's status line item displaying the caret coordinates. For interaction, problems will show up everywhere where we expect a model line to match a displayed line. Among other these might be: moving/copying lines, deleting/cutting lines, extending selection to be a line selection, etc.

Kai

> I have been looking at adding a fixed column line wrapping to TextEditor
> but see no simple way of doing this.
>
> Any ideas ?
>
> Cheers
> Zohar

Back to the top