Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » DocumentCommand and AutoIndentStrategy
DocumentCommand and AutoIndentStrategy [message #243304] Fri, 21 May 2004 16:42 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:IAdaptable Pattern
Next Topic:RCP - how tell Eclipse view cannot be a Fast View
Goto Forum:
  


Current Time: Tue May 06 22:48:30 EDT 2025

Powered by FUDForum. Page generated in 0.07288 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top