Search in sources :

Example 1 with EventData

use of alma.acs.nsstatistics.EventData in project ACS by ACS-Community.

the class EventListPart method notifyEventTypeFilterChanged.

/**
	 * @see alma.acs.eventGui2.parts.IEventListPart#notifyEventTypeFilterChange(java.lang.String)
	 */
@Override
public void notifyEventTypeFilterChanged(final String filterText) {
    //		System.out.println("EventListPart#notifyEventTypeFilterChange : " + filterText);
    if (tableFilter != null) {
        viewer.removeFilter(tableFilter);
    }
    tableFilter = new ViewerFilter() {

        @Override
        public boolean select(Viewer viewer, Object parentElement, Object element) {
            if (filterText.equals("")) {
                return true;
            }
            EventData row = (EventData) element;
            String column = row.getEventTypeName();
            if (column.toUpperCase(Locale.ENGLISH).contains(filterText.toUpperCase(Locale.ENGLISH))) {
                return true;
            }
            return false;
        }
    };
    viewer.addFilter(tableFilter);
    viewer.refresh();
}
Also used : ViewerFilter(org.eclipse.jface.viewers.ViewerFilter) TableViewer(org.eclipse.jface.viewers.TableViewer) Viewer(org.eclipse.jface.viewers.Viewer) EventData(alma.acs.nsstatistics.EventData)

Aggregations

EventData (alma.acs.nsstatistics.EventData)1 TableViewer (org.eclipse.jface.viewers.TableViewer)1 Viewer (org.eclipse.jface.viewers.Viewer)1 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)1