* org.eclipse.jface.viewers.ViewerFilter)
*/
public void initViewer(IStructuredContentProvider contentProvider, ViewerFilter filter) {
/* Headline Column */
TreeViewerColumn col = new TreeViewerColumn(fViewer, SWT.LEFT);
fCustomTree.manageColumn(col.getColumn(), new CColumnLayoutData(CColumnLayoutData.Size.FILL, 60), "Title", null, false, true);
col.getColumn().setData(COL_ID, Columns.TITLE);
col.getColumn().setMoveable(false);
if (fInitialSortColumn == Columns.TITLE) {
fCustomTree.getControl().setSortColumn(col.getColumn());
fCustomTree.getControl().setSortDirection(fInitialAscending ? SWT.UP : SWT.DOWN);
}
/* Feed Column (visible only for saved searches) */
col = new TreeViewerColumn(fViewer, SWT.LEFT);
fCustomTree.manageColumn(col.getColumn(), new CColumnLayoutData(CColumnLayoutData.Size.FIXED, Application.IS_LINUX ? 20 : 18), null, null, false, false);
col.getColumn().setData(COL_ID, NewsTableControl.Columns.FEED);
col.getColumn().setToolTipText("Feed");
if (fInitialSortColumn == NewsTableControl.Columns.FEED) {
fCustomTree.getControl().setSortColumn(col.getColumn());
fCustomTree.getControl().setSortDirection(fInitialAscending ? SWT.UP : SWT.DOWN);
}
fCustomTree.setVisible(col.getColumn(), false, false);
/* Date Column */
int width = getInitialDateColumnWidth();
col = new TreeViewerColumn(fViewer, SWT.LEFT);
fCustomTree.manageColumn(col.getColumn(), new CColumnLayoutData(CColumnLayoutData.Size.FIXED, width), "Date", null, false, true);
col.getColumn().setData(COL_ID, Columns.DATE);
col.getColumn().setMoveable(false);
if (fInitialSortColumn == Columns.DATE) {
fCustomTree.getControl().setSortColumn(col.getColumn());
fCustomTree.getControl().setSortDirection(fInitialAscending ? SWT.UP : SWT.DOWN);
}
/* Author Column */
col = new TreeViewerColumn(fViewer, SWT.LEFT);
fCustomTree.manageColumn(col.getColumn(), new CColumnLayoutData(CColumnLayoutData.Size.FILL, 20), "Author", null, false, true);
col.getColumn().setData(COL_ID, Columns.AUTHOR);
col.getColumn().setMoveable(false);
if (fInitialSortColumn == Columns.AUTHOR) {
fCustomTree.getControl().setSortColumn(col.getColumn());
fCustomTree.getControl().setSortDirection(fInitialAscending ? SWT.UP : SWT.DOWN);
}
/* Category Column */
col = new TreeViewerColumn(fViewer, SWT.LEFT);
fCustomTree.manageColumn(col.getColumn(), new CColumnLayoutData(CColumnLayoutData.Size.FILL, 20), "Category", null, false, true);
col.getColumn().setData(COL_ID, Columns.CATEGORY);
col.getColumn().setMoveable(false);
if (fInitialSortColumn == Columns.CATEGORY) {
fCustomTree.getControl().setSortColumn(col.getColumn());
fCustomTree.getControl().setSortDirection(fInitialAscending ? SWT.UP : SWT.DOWN);
}
/* Sticky Column */
col = new TreeViewerColumn(fViewer, SWT.LEFT);
fCustomTree.manageColumn(col.getColumn(), new CColumnLayoutData(CColumnLayoutData.Size.FIXED, 18), null, null, false, false);
col.getColumn().setData(COL_ID, Columns.STICKY);
col.getColumn().setMoveable(false);
col.getColumn().setToolTipText("Sticky State");
/* Apply ContentProvider */
fViewer.setContentProvider(contentProvider);
/* Create LabelProvider (Custom Owner Drawn enabled!) */