Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[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