net.sourceforge.java.feednread.frontend.components.newstable
Class NewsFeedTableViewerFilter

java.lang.Object
  extended byorg.eclipse.jface.viewers.ViewerFilter
      extended bynet.sourceforge.java.feednread.frontend.components.newstable.NewsFeedTableViewerFilter

public class NewsFeedTableViewerFilter
extends ViewerFilter

Filters NewsFeedEntry objects based on a given keyword.

Author:
Sebastian Machhausen

Field Summary
private  String filterText
           
 
Constructor Summary
NewsFeedTableViewerFilter()
           
 
Method Summary
 String getFilterText()
           Gets the filter text.
 boolean select(Viewer viewer, Object parentElement, Object element)
           Decides whether or not the element in the parentElement structure displayed in the specified Viewer has to be selected.
 void setFilterText(String filterText)
           Sets the filter text to the specified value.
 
Methods inherited from class org.eclipse.jface.viewers.ViewerFilter
filter, filter, isFilterProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filterText

private String filterText
Constructor Detail

NewsFeedTableViewerFilter

public NewsFeedTableViewerFilter()
Method Detail

select

public boolean select(Viewer viewer,
                      Object parentElement,
                      Object element)

Decides whether or not the element in the parentElement structure displayed in the specified Viewer has to be selected.

The selection implicates an element's title, description and categories. If one of these fields matches the current filter the element will be selected otherwise rejected.

Parameters:
viewer - the Viewer for which selection is done
parentElement - the parent element
element - the element to potentially select
Returns:
true if the specified element was selected; false it was rejected

getFilterText

public String getFilterText()

Gets the filter text.

Returns:
the filter text; null or an empty String indicates no filtering, i.e. disabled filtering

setFilterText

public void setFilterText(String filterText)

Sets the filter text to the specified value.

Parameters:
filterText - the filter text to set; null or an empty String for no filtering, i.e. disabled filtering