Example usage for org.eclipse.jface.viewers Viewer setData

List of usage examples for org.eclipse.jface.viewers Viewer setData

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers Viewer setData.

Prototype

public void setData(String key, Object value) 

Source Link

Document

Sets the value of the property with the given name to the given value, or to null if the property is to be removed.

Usage

From source file:org.eclipse.mylyn.internal.reviews.ui.compare.ReviewCompareAnnotationSupport.java

License:Open Source License

public static ReviewCompareAnnotationSupport getAnnotationSupport(Viewer contentViewer) {
    ReviewCompareAnnotationSupport support = (ReviewCompareAnnotationSupport) contentViewer
            .getData(KEY_ANNOTAION_SUPPORT);
    if (support == null) {
        support = new ReviewCompareAnnotationSupport(contentViewer);
        contentViewer.setData(KEY_ANNOTAION_SUPPORT, support);
    }/*w  w  w. j  a v  a2 s.c  o m*/
    return support;
}

From source file:org.eclipse.mylyn.reviews.r4e.ui.internal.utils.UIUtils.java

License:Open Source License

/**
 * Method getCompareAnnotationSupport./*from www  .j a  v a  2s. co  m*/
 * 
 * @param aSourceViewer
 *            ISourceViewer
 * @param aFileContext
 *            R4EUIFileContext
 * @return IReviewAnnotationSupport
 */
public static IReviewAnnotationSupport getCompareAnnotationSupport(Viewer aViewer, Object aFileContext) {
    IReviewAnnotationSupport support = (IReviewAnnotationSupport) aViewer
            .getData(COMPARE_KEY_ANNOTATION_SUPPORT);
    if (support == null) {
        support = new R4ECompareAnnotationSupport(aViewer, aFileContext);
        aViewer.setData(COMPARE_KEY_ANNOTATION_SUPPORT, support);
    }
    return support;
}