Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Editor folding
Editor folding [message #466609] Sun, 22 April 2007 21: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 14:34 Go to previous message
Dani Megert is currently offline Dani MegertFriend
Messages: 3802
Registered: July 2009
Senior Member
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 Apr 27 02:16:33 GMT 2024

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

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

Back to the top