Java Code Examples for org.eclipse.jface.text.source.projection.ProjectionAnnotationModel#expandAll()

The following examples show how to use org.eclipse.jface.text.source.projection.ProjectionAnnotationModel#expandAll() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TexUncollapseAction.java    From texlipse with Eclipse Public License 1.0 5 votes vote down vote up
public void run(IAction action) {
    TexSelections selection = new TexSelections(getTextEditor());
    
    int firstOffset = selection.getStartLine().getOffset();
    int lastOffset = selection.getEndLine().getOffset();
    
    ProjectionAnnotationModel model = (ProjectionAnnotationModel) getTextEditor()
    .getAdapter(ProjectionAnnotationModel.class);
    
    if (model != null) {
        // the predefined method permits us to do this, even if length=0
        model.expandAll(firstOffset, lastOffset - firstOffset);
    }
}
 
Example 2
Source File: PyUnCollapse.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void run(IAction action) {
    PySelection ps = PySelectionFromEditor.createPySelectionFromEditor(getTextEditor());

    ProjectionAnnotationModel model = getTextEditor().getAdapter(
            ProjectionAnnotationModel.class);

    if (model != null) {
        model.expandAll(ps.getAbsoluteCursorOffset(), ps.getSelLength());
    }

}