Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2011 itemis AG ( and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at /
import  org.eclipse.jface.text.source.ISourceViewer;
import  org.eclipse.jface.viewers.ISelection;
import  org.eclipse.jface.viewers.Viewer;
import  org.eclipse.swt.widgets.Composite;
import  org.eclipse.swt.widgets.Control;

Michael Clay - Initial contribution and API
public abstract class AbstractContentViewer extends Viewer {
	protected Composite parent;
	protected CompareConfiguration compareConfiguration;
	protected ISelection selection;
	protected ISourceViewer sourceViewer;
	protected Object input;
	public void init(Composite parent, CompareConfiguration config) {
		this. = parent;
		this. = config;
	public Control getControl() {
		if ( == null) {
		return  != null ? .getTextWidget() : null;
	protected abstract ISourceViewer createSourceViewer();
	protected abstract void configureSourceViewer(ISourceViewer sourceViewer);
	public Object getInput() {
		return this.;
	public ISelection getSelection() {
		return this.;
	public void refresh() {
	public void setInput(Object input) {
		this. = input;
	public void setSelection(ISelection selectionboolean reveal) {
		this. = selection;
	public Composite getParent() {
		return ;
	public CompareConfiguration getCompareConfiguration() {
New to GrepCode? Check out our FAQ X