org.eclipse.xtext.ui.compare
Class AbstractContentViewer

java.lang.Object
  extended by org.eclipse.jface.viewers.Viewer
      extended by org.eclipse.xtext.ui.compare.AbstractContentViewer
All Implemented Interfaces:
org.eclipse.jface.viewers.IInputProvider, org.eclipse.jface.viewers.IInputSelectionProvider, org.eclipse.jface.viewers.ISelectionProvider
Direct Known Subclasses:
DefaultContentViewer

public abstract class AbstractContentViewer
extends org.eclipse.jface.viewers.Viewer

Author:
Michael Clay - Initial contribution and API

Field Summary
protected  org.eclipse.compare.CompareConfiguration compareConfiguration
           
protected  java.lang.Object input
           
protected  org.eclipse.swt.widgets.Composite parent
           
protected  org.eclipse.jface.viewers.ISelection selection
           
protected  org.eclipse.jface.text.source.ISourceViewer sourceViewer
           
 
Fields inherited from class org.eclipse.jface.viewers.Viewer
WIDGET_DATA_KEY
 
Constructor Summary
AbstractContentViewer()
           
 
Method Summary
protected abstract  void configureSourceViewer(org.eclipse.jface.text.source.ISourceViewer sourceViewer)
           
protected abstract  org.eclipse.jface.text.source.ISourceViewer createSourceViewer()
           
 org.eclipse.compare.CompareConfiguration getCompareConfiguration()
           
 org.eclipse.swt.widgets.Control getControl()
          Returns the primary control associated with this viewer.
 java.lang.Object getInput()
          Returns the input.
 org.eclipse.swt.widgets.Composite getParent()
           
 org.eclipse.jface.viewers.ISelection getSelection()
          Returns the current selection for this provider.
 void init(org.eclipse.swt.widgets.Composite parent, org.eclipse.compare.CompareConfiguration config)
           
 void refresh()
          Refreshes this viewer completely with information freshly obtained from this viewer's model.
 void setInput(java.lang.Object input)
          Sets or clears the input for this viewer.
 void setSelection(org.eclipse.jface.viewers.ISelection selection, boolean reveal)
          Sets a new selection for this viewer and optionally makes it visible.
 
Methods inherited from class org.eclipse.jface.viewers.Viewer
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, inputChanged, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

protected org.eclipse.swt.widgets.Composite parent

compareConfiguration

protected org.eclipse.compare.CompareConfiguration compareConfiguration

selection

protected org.eclipse.jface.viewers.ISelection selection

sourceViewer

protected org.eclipse.jface.text.source.ISourceViewer sourceViewer

input

protected java.lang.Object input
Constructor Detail

AbstractContentViewer

public AbstractContentViewer()
Method Detail

init

public void init(org.eclipse.swt.widgets.Composite parent,
                 org.eclipse.compare.CompareConfiguration config)

getControl

public org.eclipse.swt.widgets.Control getControl()
Description copied from class: org.eclipse.jface.viewers.Viewer
Returns the primary control associated with this viewer.

Specified by:
getControl in class org.eclipse.jface.viewers.Viewer
Returns:
the SWT control which displays this viewer's content

createSourceViewer

protected abstract org.eclipse.jface.text.source.ISourceViewer createSourceViewer()

configureSourceViewer

protected abstract void configureSourceViewer(org.eclipse.jface.text.source.ISourceViewer sourceViewer)

getInput

public java.lang.Object getInput()
Description copied from interface: org.eclipse.jface.viewers.IInputProvider
Returns the input.

Specified by:
getInput in interface org.eclipse.jface.viewers.IInputProvider
Specified by:
getInput in class org.eclipse.jface.viewers.Viewer
Returns:
the input object

getSelection

public org.eclipse.jface.viewers.ISelection getSelection()
Description copied from interface: org.eclipse.jface.viewers.ISelectionProvider
Returns the current selection for this provider.

Specified by:
getSelection in interface org.eclipse.jface.viewers.ISelectionProvider
Specified by:
getSelection in class org.eclipse.jface.viewers.Viewer
Returns:
the current selection

refresh

public void refresh()
Description copied from class: org.eclipse.jface.viewers.Viewer
Refreshes this viewer completely with information freshly obtained from this viewer's model.

Specified by:
refresh in class org.eclipse.jface.viewers.Viewer

setInput

public void setInput(java.lang.Object input)
Description copied from class: org.eclipse.jface.viewers.Viewer
Sets or clears the input for this viewer.

Specified by:
setInput in class org.eclipse.jface.viewers.Viewer
Parameters:
input - the input of this viewer, or null if none

setSelection

public void setSelection(org.eclipse.jface.viewers.ISelection selection,
                         boolean reveal)
Description copied from class: org.eclipse.jface.viewers.Viewer
Sets a new selection for this viewer and optionally makes it visible.

Subclasses must implement this method.

Specified by:
setSelection in class org.eclipse.jface.viewers.Viewer
Parameters:
selection - the new selection
reveal - true if the selection is to be made visible, and false otherwise

getParent

public org.eclipse.swt.widgets.Composite getParent()

getCompareConfiguration

public org.eclipse.compare.CompareConfiguration getCompareConfiguration()