Search in sources :

Example 1 with IChangeRulerColumn

use of org.eclipse.jface.text.source.IChangeRulerColumn in project eclipse.platform.text by eclipse.

the class LineNumberColumn method updateDeletedColor.

private void updateDeletedColor(AnnotationPreference pref, IPreferenceStore store, IVerticalRulerColumn column) {
    if (pref != null && column instanceof IChangeRulerColumn) {
        RGB rgb = getColorFromAnnotationPreference(store, pref);
        ((IChangeRulerColumn) column).setDeletedColor(getSharedColors().getColor(rgb));
    }
}
Also used : IChangeRulerColumn(org.eclipse.jface.text.source.IChangeRulerColumn) RGB(org.eclipse.swt.graphics.RGB)

Example 2 with IChangeRulerColumn

use of org.eclipse.jface.text.source.IChangeRulerColumn in project eclipse.platform.text by eclipse.

the class LineNumberColumn method updateChangedColor.

private void updateChangedColor(AnnotationPreference pref, IPreferenceStore store, IVerticalRulerColumn column) {
    if (pref != null && column instanceof IChangeRulerColumn) {
        RGB rgb = getColorFromAnnotationPreference(store, pref);
        ((IChangeRulerColumn) column).setChangedColor(getSharedColors().getColor(rgb));
    }
}
Also used : IChangeRulerColumn(org.eclipse.jface.text.source.IChangeRulerColumn) RGB(org.eclipse.swt.graphics.RGB)

Example 3 with IChangeRulerColumn

use of org.eclipse.jface.text.source.IChangeRulerColumn in project eclipse.platform.text by eclipse.

the class LineNumberColumn method installChangeRulerModel.

/**
 * Installs the differ annotation model with the current quick diff display.
 *
 * @param column the column to install the model on
 */
private void installChangeRulerModel(IVerticalRulerColumn column) {
    if (column instanceof IChangeRulerColumn) {
        IAnnotationModel model = getAnnotationModelWithDiffer();
        ((IChangeRulerColumn) column).setModel(model);
        if (model != null) {
            ISourceViewer viewer = fViewer;
            if (viewer != null && viewer.getAnnotationModel() == null && column.getControl() != null)
                viewer.showAnnotations(true);
        }
    }
}
Also used : IChangeRulerColumn(org.eclipse.jface.text.source.IChangeRulerColumn) IAnnotationModel(org.eclipse.jface.text.source.IAnnotationModel) ISourceViewer(org.eclipse.jface.text.source.ISourceViewer)

Example 4 with IChangeRulerColumn

use of org.eclipse.jface.text.source.IChangeRulerColumn in project eclipse.platform.text by eclipse.

the class LineNumberColumn method updateAddedColor.

private void updateAddedColor(AnnotationPreference pref, IPreferenceStore store, IVerticalRulerColumn column) {
    if (pref != null && column instanceof IChangeRulerColumn) {
        RGB rgb = getColorFromAnnotationPreference(store, pref);
        ((IChangeRulerColumn) column).setAddedColor(getSharedColors().getColor(rgb));
    }
}
Also used : IChangeRulerColumn(org.eclipse.jface.text.source.IChangeRulerColumn) RGB(org.eclipse.swt.graphics.RGB)

Example 5 with IChangeRulerColumn

use of org.eclipse.jface.text.source.IChangeRulerColumn in project eclipse.platform.text by eclipse.

the class LineNumberColumn method getDiffer.

/**
 * Extracts the line differ from the displayed document's annotation model. If none can be found,
 * <code>null</code> is returned.
 *
 * @return the line differ, or <code>null</code> if none could be found
 */
private IAnnotationModel getDiffer() {
    // get annotation model extension
    ISourceViewer viewer = fViewer;
    if (viewer == null)
        return null;
    IAnnotationModel m = viewer.getAnnotationModel();
    if (m == null && fDelegate instanceof IChangeRulerColumn)
        m = ((IChangeRulerColumn) fDelegate).getModel();
    if (!(m instanceof IAnnotationModelExtension))
        return null;
    IAnnotationModelExtension model = (IAnnotationModelExtension) m;
    // get diff model if it exists already
    return model.getAnnotationModel(IChangeRulerColumn.QUICK_DIFF_MODEL_ID);
}
Also used : IChangeRulerColumn(org.eclipse.jface.text.source.IChangeRulerColumn) IAnnotationModelExtension(org.eclipse.jface.text.source.IAnnotationModelExtension) IAnnotationModel(org.eclipse.jface.text.source.IAnnotationModel) ISourceViewer(org.eclipse.jface.text.source.ISourceViewer)

Aggregations

IChangeRulerColumn (org.eclipse.jface.text.source.IChangeRulerColumn)8 IAnnotationModel (org.eclipse.jface.text.source.IAnnotationModel)4 ISourceViewer (org.eclipse.jface.text.source.ISourceViewer)3 RGB (org.eclipse.swt.graphics.RGB)3 IAnnotationModelExtension (org.eclipse.jface.text.source.IAnnotationModelExtension)2 ILineDifferExtension (org.eclipse.jface.text.source.ILineDifferExtension)2 MessageDialogWithToggle (org.eclipse.jface.dialogs.MessageDialogWithToggle)1 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)1 AnnotationModel (org.eclipse.jface.text.source.AnnotationModel)1 LineNumberChangeRulerColumn (org.eclipse.jface.text.source.LineNumberChangeRulerColumn)1 QuickDiff (org.eclipse.ui.texteditor.quickdiff.QuickDiff)1