Search in sources :

Example 1 with IMarkRegionTarget

use of org.eclipse.jface.text.IMarkRegionTarget in project eclipse.platform.text by eclipse.

the class MarkAction method run.

@Override
public void run() {
    ITextEditor editor = getTextEditor();
    if (editor == null)
        return;
    IMarkRegionTarget target = editor.getAdapter(IMarkRegionTarget.class);
    if (target == null)
        return;
    switch(fType) {
        case SET_MARK:
            target.setMarkAtCursor(true);
            break;
        case CLEAR_MARK:
            target.setMarkAtCursor(false);
            break;
        case SWAP_MARK:
            target.swapMarkAndCursor();
            break;
    }
}
Also used : IMarkRegionTarget(org.eclipse.jface.text.IMarkRegionTarget)

Aggregations

IMarkRegionTarget (org.eclipse.jface.text.IMarkRegionTarget)1