Search in sources :

Example 1 with TextViewerDeleteLineTarget

use of org.eclipse.ui.texteditor.TextViewerDeleteLineTarget in project xtext-eclipse by eclipse.

the class TextViewerDeleteLineAction method update.

/*
	 * @see IUpdate#update()
	 */
@Override
public void update() {
    super.update();
    if (!isEnabled())
        return;
    if (!canModifyViewer()) {
        setEnabled(false);
        return;
    }
    ITextViewer viewer = getTextViewer();
    if (viewer != null) {
        if (fTarget == null) {
            fTarget = new TextViewerDeleteLineTarget(viewer);
        }
    } else {
        fTarget = null;
    }
    setEnabled(fTarget != null);
}
Also used : ITextViewer(org.eclipse.jface.text.ITextViewer) TextViewerDeleteLineTarget(org.eclipse.ui.texteditor.TextViewerDeleteLineTarget)

Aggregations

ITextViewer (org.eclipse.jface.text.ITextViewer)1 TextViewerDeleteLineTarget (org.eclipse.ui.texteditor.TextViewerDeleteLineTarget)1