Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-text-dev] Formatting tosses annotations/markers


Hi Kai,

In 2.1 the formatting strategy simply returned a formatted string.  Would like to see this functionality remain.  Assuming that bug 63723 is fixed, and the IFormattingStrategy.format(String, boolean,String, int[])  method is called, will the method  be deprecated?  


Thanks,
Scott Fairbrother
Eclipse/WebSphere Studio Jumpstart Team
607 Pinewood Dr
Apex , NC 27502

Voice : 919-367-9345  TL:  223-7851

The Java Developer's Guide to Eclipse - http://www.aw.com/catalog/academic/product/1,4096,0321159640,00.html?type=PRE
WebSphere Studio - http://www.ibm.com/software/ad/adstudio
Ready for WebSphere Studio partner program - http://www.developer.ibm.com/websphere/ready.html



Kai-Uwe Maetzel <kai-uwe_maetzel@xxxxxxxxxx>
Sent by: platform-text-dev-admin@xxxxxxxxxxx

05/25/2004 04:03 AM

Please respond to
platform-text-dev

To
platform-text-dev@xxxxxxxxxxx
cc
Subject
Re: [platform-text-dev] Formatting tosses annotations/markers






You replace the complete content of the document. Thus, all positions of the annotations get deleted. Correct behavior.

Kai



Scott Fairbrother <scottf@xxxxxxxxxx>
Sent by: platform-text-dev-admin@xxxxxxxxxxx

05/24/2004 08:17 PM

Please respond to
platform-text-dev@xxxxxxxxxxx

To
platform-text-dev@xxxxxxxxxxx
cc
Subject
[platform-text-dev] Formatting tosses annotations/markers








Has anyone had problems losing annotations after setting or replacing IDocument text?  The use case I'm having problems with is in content formatting.  I grab the formatting context on formattingStart and then get the document text, from the context.  I format the string in the keyWordsToUpper method and then set the document text.  This all seems to work, the doc is dirty and view is updated however all markers and annotations are lost.  

/*

 * (non-Javadoc)

 *
 * @see org.eclipse.jface.text.formatter.IFormattingStrategyExtension#format()

 */

public void format() {

  IDocument document = (IDocument) sqlFormattingContext

      .getProperty(FormattingContextProperties.CONTEXT_MEDIUM);

  if (document != null)

    document.set(keyWordsToUpper(document.get()));

}


Thanks,
Scott Fairbrother
Eclipse/WebSphere Studio Jumpstart Team
607 Pinewood Dr
Apex , NC 27502

Voice : 919-367-9345  TL:  223-7851

The Java Developer's Guide to Eclipse - http://www.aw.com/catalog/academic/product/1,4096,0321159640,00.html?type=PRE
WebSphere Studio - http://www.ibm.com/software/ad/adstudio
Ready for WebSphere Studio partner program - http://www.developer.ibm.com/websphere/ready.html


Back to the top