DocumentCommand and AutoIndentStrategy [message #243304] |
Fri, 21 May 2004 16:42  |
Eclipse User |
|
|
|
Originally posted by: gdiminished.hotmail.com
Hi
Does anyone know much about this class? The document in the API specification is vague at best... what I'd like to know is how to change a document in two places at the same time in the DefaultAutoIndentStrategy class. Here is an example.
Before:
some_text
User types in a '|' character
After
some_text
| _
where "_" is where the carat should be. So in other words, when the user enters a '|' character, the top line gets shifted over AND a tab is appended to the document command text, so the new offset and the text from the previous line are aligned. That's two changes, I believe. I noticed there is an addCommand method in the DocumentCommand class, but I have no idea what this does.
Cheers,
Derek
|
|
|
Re: DocumentCommand and AutoIndentStrategy [message #243321 is a reply to message #243304] |
Fri, 21 May 2004 17:12  |
Eclipse User |
|
|
|
You can manipulate the DocumentCommand in an indent strategy by overriding
customizeDocumentCommand(IDocument, DocumentCommand)
Check the Ant auto indent strategy for an example (AntAutoIndentStrategy)
HTH
Darins
"Gdiminished" <gdiminished@hotmail.com> wrote in message
news:c8lpkh$j4d$1@eclipse.org...
> Hi
>
> Does anyone know much about this class? The document in the API
specification is vague at best... what I'd like to know is how to change a
document in two places at the same time in the DefaultAutoIndentStrategy
class. Here is an example.
>
> Before:
> some_text
>
> User types in a '|' character
>
> After
> some_text
> | _
>
> where "_" is where the carat should be. So in other words, when the user
enters a '|' character, the top line gets shifted over AND a tab is appended
to the document command text, so the new offset and the text from the
previous line are aligned. That's two changes, I believe. I noticed there
is an addCommand method in the DocumentCommand class, but I have no idea
what this does.
>
> Cheers,
> Derek
|
|
|
Powered by
FUDForum. Page generated in 0.07288 seconds