net.sourceforge.java.feednread.frontend.wizard
Class WatchSettingsTableContentProvider

java.lang.Object
  extended bynet.sourceforge.java.feednread.frontend.wizard.WatchSettingsTableContentProvider
All Implemented Interfaces:
IContentProvider, IStructuredContentProvider, ITableContentProvider

public class WatchSettingsTableContentProvider
extends Object
implements IStructuredContentProvider, ITableContentProvider

Manages a WatchSettings instance whose WatchSettingsEntries are displayed in a TableViewer.

Author:
Sebastian Machhausen

Field Summary
static int CASE_SENSITIVE_COLUMN
           The index of the case sensitive column
static int KEYWORD_COLUMN
           The index of the keyword column
private  WatchSettings settings
           The WatchSettings instance to manage
private  TableViewer viewer
           The TableViewer to provide the data for
static int WHOLE_WORD_COLUMN
           The index of the whole word column
 
Constructor Summary
WatchSettingsTableContentProvider(TableViewer viewer)
           Creates a new WatchSettingsTableContentProvider which provides the data for the specified TableViewer.
 
Method Summary
 void add(WatchSettingsEntry entry)
           Adds the specified WatchSettingsEntry to the managed WatchSettings.
 void dispose()
           Disposes this WatchSettingsTableContentProvider
 Object getColumnValue(Object element, int columnIndex)
           Gets the column value for the specified element at the given columnIndex.
 Object[] getElements(Object inputElement)
           Returns the elements to display in the Viewer when its input is set to the given element.
 void inputChanged(Viewer viewer, Object oldInput, Object newInput)
           Notifies this content provider that the given viewer's input has been switched to a different element.
 void remove(WatchSettingsEntry entry)
           Removes the specified WatchSettingsEntry from the managed WatchSettings.
 void removeAll()
           Removes all WacthSettingsEntries from the managed WatchSettings.
 void update(WatchSettingsEntry entry)
           Notifies the Viewer that the specified WatchSettingsEntry has been updated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEYWORD_COLUMN

public static final int KEYWORD_COLUMN

The index of the keyword column

See Also:
Constant Field Values

CASE_SENSITIVE_COLUMN

public static final int CASE_SENSITIVE_COLUMN

The index of the case sensitive column

See Also:
Constant Field Values

WHOLE_WORD_COLUMN

public static final int WHOLE_WORD_COLUMN

The index of the whole word column

See Also:
Constant Field Values

viewer

private TableViewer viewer

The TableViewer to provide the data for


settings

private WatchSettings settings

The WatchSettings instance to manage

Constructor Detail

WatchSettingsTableContentProvider

public WatchSettingsTableContentProvider(TableViewer viewer)

Creates a new WatchSettingsTableContentProvider which provides the data for the specified TableViewer.

Parameters:
viewer - the TableViewer to provide the data for
Method Detail

getElements

public Object[] getElements(Object inputElement)

Returns the elements to display in the Viewer when its input is set to the given element. These elements can be presented as rows in a table, items in a list, etc. The result is not modified by the Viewer.

Specified by:
getElements in interface IStructuredContentProvider
Parameters:
inputElement - the input element
Returns:
the array of elements to display in the Viewer
See Also:
IStructuredContentProvider.getElements(java.lang.Object)

dispose

public void dispose()

Disposes this WatchSettingsTableContentProvider

Specified by:
dispose in interface IContentProvider
See Also:
IContentProvider.dispose()

inputChanged

public void inputChanged(Viewer viewer,
                         Object oldInput,
                         Object newInput)

Notifies this content provider that the given viewer's input has been switched to a different element. The viewer should not be updated during this call, as it might be in the process of being disposed.

Specified by:
inputChanged in interface IContentProvider
Parameters:
viewer - the viewer
oldInput - the old input element, or null if the viewer did not previously have an input
newInput - the new input element, or null if the viewer does not have an input
See Also:
IContentProvider.inputChanged(org.eclipse.jface.viewers.Viewer, java.lang.Object, java.lang.Object)

getColumnValue

public Object getColumnValue(Object element,
                             int columnIndex)

Gets the column value for the specified element at the given columnIndex.

Specified by:
getColumnValue in interface ITableContentProvider
Parameters:
element - the model element for which to query the colum value
columnIndex - the index of the column to query the value for
Returns:
the value for the element at the given columnIndex

add

public void add(WatchSettingsEntry entry)

Adds the specified WatchSettingsEntry to the managed WatchSettings. Notifies the Viewer that the specified WatchSettingsEntry has been added.

Parameters:
entry - the WatchSettingsEntry to add

remove

public void remove(WatchSettingsEntry entry)

Removes the specified WatchSettingsEntry from the managed WatchSettings. Notifies the Viewer that the specified WatchSettingsEntry has been removed.

Parameters:
entry - the WatchSettingsEntry to remove
See Also:
removeAll()

removeAll

public void removeAll()

Removes all WacthSettingsEntries from the managed WatchSettings. Notifies the Viewer that all entries have been removed.

See Also:
remove(WatchSettingsEntry)

update

public void update(WatchSettingsEntry entry)

Notifies the Viewer that the specified WatchSettingsEntry has been updated.

Parameters:
entry - the WatchSettingsEntry to update