Search in sources :

Example 1 with ITextEditorExtension3

use of org.eclipse.ui.texteditor.ITextEditorExtension3 in project eclipse.platform.text by eclipse.

the class ReferenceSelectionAction method run.

@Override
public void run() {
    // create if needed, so the user does not have to toggle display when he selects a reference
    DocumentLineDiffer differ = getDiffer(true);
    if (differ == null)
        return;
    if (fEditor instanceof ITextEditorExtension3) {
        ITextEditorExtension3 extension = (ITextEditorExtension3) fEditor;
        IQuickDiffReferenceProvider provider = getProvider();
        if (provider != null) {
            provider.setActiveEditor(fEditor);
            if (provider.isEnabled()) {
                differ.setReferenceProvider(provider);
                extension.showChangeInformation(true);
                setEnabled(true);
            } else
                setEnabled(false);
        }
    }
}
Also used : ITextEditorExtension3(org.eclipse.ui.texteditor.ITextEditorExtension3) IQuickDiffReferenceProvider(org.eclipse.ui.texteditor.quickdiff.IQuickDiffReferenceProvider)

Example 2 with ITextEditorExtension3

use of org.eclipse.ui.texteditor.ITextEditorExtension3 in project eclipse.platform.text by eclipse.

the class QuickDiffToggleAction method run.

@Override
public void run(IAction action) {
    fProxy = action;
    if (fEditor == null)
        return;
    if (fEditor instanceof ITextEditorExtension3) {
        ITextEditorExtension3 extension = (ITextEditorExtension3) fEditor;
        extension.showChangeInformation(!extension.isChangeInformationShowing());
    }
}
Also used : ITextEditorExtension3(org.eclipse.ui.texteditor.ITextEditorExtension3)

Aggregations

ITextEditorExtension3 (org.eclipse.ui.texteditor.ITextEditorExtension3)2 IQuickDiffReferenceProvider (org.eclipse.ui.texteditor.quickdiff.IQuickDiffReferenceProvider)1