Search in sources :

Example 1 with InclusivePositionUpdater

use of org.eclipse.jface.text.link.InclusivePositionUpdater in project che by eclipse.

the class ParameterGuessingProposal method ensurePositionCategoryInstalled.

private void ensurePositionCategoryInstalled(final IDocument document, LinkedModeModel model) {
    if (!document.containsPositionCategory(getCategory())) {
        document.addPositionCategory(getCategory());
        fUpdater = new InclusivePositionUpdater(getCategory());
        document.addPositionUpdater(fUpdater);
        model.addLinkingListener(new ILinkedModeListener() {

            /*
				 * @see org.eclipse.jface.text.link.ILinkedModeListener#left(org.eclipse.jface.text.link.LinkedModeModel, int)
				 */
            public void left(LinkedModeModel environment, int flags) {
                ensurePositionCategoryRemoved(document);
            }

            public void suspend(LinkedModeModel environment) {
            }

            public void resume(LinkedModeModel environment, int flags) {
            }
        });
    }
}
Also used : InclusivePositionUpdater(org.eclipse.jface.text.link.InclusivePositionUpdater) LinkedModeModel(org.eclipse.jface.text.link.LinkedModeModel) ILinkedModeListener(org.eclipse.jface.text.link.ILinkedModeListener) Point(org.eclipse.swt.graphics.Point)

Aggregations

ILinkedModeListener (org.eclipse.jface.text.link.ILinkedModeListener)1 InclusivePositionUpdater (org.eclipse.jface.text.link.InclusivePositionUpdater)1 LinkedModeModel (org.eclipse.jface.text.link.LinkedModeModel)1 Point (org.eclipse.swt.graphics.Point)1