Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Editor folding
Editor folding [message #466609] Sun, 22 April 2007 17:43 Go to next message
Eclipse UserFriend
Originally posted by: jweeks.neuraldk.org

Hello,

I've followed the tutorial on
http://www.eclipse.org/articles/Article-Folding-in-Eclipse-T ext-Editors/folding.html
in an attempt to add folding to my editor plugin, but I'm not noticing any
folds in the editor, and I'm not quite sure where I should be looking to
debug the fault (as no exceptions are thrown).

I've followed the code, almost, to the t, aside from the generation of
folds. For that, I've simply hardcoded a couple folds, as shown below.
Again, though, I see no folds in the editor.

I'm hoping someone might point me in the correct direction to understand
where I've gone wrong, as there's currently only obvious signs of failure,
aside from the fact that it simply doesn't work :)

protected void updateFolds()
{
Annotation[] annots = new Annotation[2];
HashMap newAnnots = new HashMap();

/* two annotations... */
ProjectionAnnotation pann = new ProjectionAnnotation();
newAnnots.put( pann, new Position(5, 3));
annots[0] = pann;

pann = new ProjectionAnnotation();
newAnnots.put( pann, new Position(10, 2));
annots[1] = pann;

annotationModel.modifyAnnotations( oldAnnotations, newAnnots, null);
oldAnnotations = annots;
}

Thanks,
Jeff
Re: Editor folding [message #466754 is a reply to message #466609] Tue, 24 April 2007 10:34 Go to previous message
Eclipse UserFriend
Jeff Weeks [ neuraldk ] wrote:

>Hello,
>
>I've followed the tutorial on
> http://www.eclipse.org/articles/Article-Folding-in-Eclipse-T ext-Editors/folding.html
>in an attempt to add folding to my editor plugin, but I'm not noticing any
>folds in the editor, and I'm not quite sure where I should be looking to
>debug the fault (as no exceptions are thrown).
>
>I've followed the code, almost, to the t, aside from the generation of
>folds. For that, I've simply hardcoded a couple folds, as shown below.
>Again, though, I see no folds in the editor.
>
>I'm hoping someone might point me in the correct direction to understand
>where I've gone wrong, as there's currently only obvious signs of failure,
>aside from the fact that it simply doesn't work :)
>
> protected void updateFolds()
> {
> Annotation[] annots = new Annotation[2];
> HashMap newAnnots = new HashMap();
>
> /* two annotations... */
> ProjectionAnnotation pann = new ProjectionAnnotation();
> newAnnots.put( pann, new Position(5, 3));
> annots[0] = pann;
>
> pann = new ProjectionAnnotation();
> newAnnots.put( pann, new Position(10, 2));
> annots[1] = pann;
>
> annotationModel.modifyAnnotations( oldAnnotations, newAnnots, null);
>
>
The above method does not exist.

Dani

> oldAnnotations = annots;
> }
>
>Thanks,
>Jeff
>
>
Previous Topic:JFACE or SWT
Next Topic:run a Java-6-RCP-app with a Java-5-JRE?
Goto Forum:
  


Current Time: Sat May 17 06:16:52 EDT 2025

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

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

Back to the top