Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 248114 Details for
Bug 448416
[projection] nested folding is only partially supported
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
modified DefineFoldingRegionAction class from org.eclipse.ui.examples.javaeditor.JavaEditor
file_448416.txt (text/plain), 1.72 KB, created by
Bill Fenlason
on 2014-10-22 15:40:34 EDT
(
hide
)
Description:
modified DefineFoldingRegionAction class from org.eclipse.ui.examples.javaeditor.JavaEditor
Filename:
MIME Type:
Creator:
Bill Fenlason
Created:
2014-10-22 15:40:34 EDT
Size:
1.72 KB
patch
obsolete
> private class DefineFoldingRegionAction extends TextEditorAction { > > public DefineFoldingRegionAction(ResourceBundle bundle, String prefix, ITextEditor editor) { > super(bundle, prefix, editor); > } > > private IAnnotationModel getAnnotationModel(ITextEditor editor) { > return (IAnnotationModel)editor.getAdapter(ProjectionAnnotationModel.class); > } > > /* > * @see org.eclipse.jface.action.Action#run() > */ > public void run() { > ITextEditor editor= getTextEditor(); > ISelection selection= editor.getSelectionProvider().getSelection(); > if (selection instanceof ITextSelection) { > ITextSelection textSelection= (ITextSelection)selection; > if (!textSelection.isEmpty()) { > IAnnotationModel model= getAnnotationModel(editor); > if (model != null) { > > int start= textSelection.getStartLine(); > int end= textSelection.getEndLine(); > > try { > IDocument document= editor.getDocumentProvider().getDocument(editor.getEditorInput()); > int offset= document.getLineOffset(start); > int endOffset= document.getLineOffset(end) + document.getLineLength(end); // bug fix > Iterator e= model.getAnnotationIterator(); // added > while (e.hasNext()) { // added > ProjectionAnnotation annotation= (ProjectionAnnotation)e.next(); // added > if (model.getPosition(annotation).getOffset() == offset) // added > model.removeAnnotation(annotation); // added > } // added > if (end > start) { // added > Position position= new Position(offset, endOffset - offset); > model.addAnnotation(new ProjectionAnnotation(), position); > } // added > } catch (BadLocationException x) { > // ignore > } > } > } > } > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 448416
: 248114