int topIndex = viewer.getTopIndex(); int caret = viewer.getTextWidget().getCaretOffset();
	private void addWatcher(File file, int interval, int numLines, Vector filters, boolean saveState)	{			// Add the new tab		CTabItem newItem = new CTabItem(m_folder, 0);		newItem.setText(file.getName());		setViewTitle(file.getName());		m_folder.setSelection(newItem);				// Create the text viewer and associated document		final TextViewer viewer = new TextViewer(m_folder, SWT.H_SCROLL | SWT.V_SCROLL);		newItem.setControl(viewer.getControl());		final Document newDoc = new Document();		viewer.setDocument(newDoc);		viewer.setEditable(false);				// Add a context menu to the text viewer		MenuManager menuMgr = new MenuManager("#PopupMenu");		menuMgr.setRemoveAllWhenShown(true);		menuMgr.addMenuListener(new IMenuListener() {			public void menuAboutToShow(IMenuManager manager) {				LogWatcherView.this.fillContextMenu(manager);			}		});		Menu menu = menuMgr.createContextMenu(viewer.getControl());		viewer.getControl().setMenu(menu);		getSite().registerContextMenu(menuMgr, viewer);				// Add the watcher		TextFileWatcher watcher;		try {			watcher = new TextFileWatcher(file, interval, numLines);			watcher.setFilters(filters);		}		catch (FileNotFoundException e) {			// Shouldn't happen!			e.printStackTrace();			return;		}				final WatcherEntry entry = new WatcherEntry(viewer,  watcher, newItem, filters);		m_watchers.add(entry);					// Add a listener		final Display display = Display.getCurrent();		watcher.addListener(new WatcherUpdateListener() {			public void update(BoundedList list)			{				final BoundedList flist = list;								display.asyncExec(new Runnable() {					public void run()					{						int topIndex = viewer.getTopIndex();						int caret = viewer.getTextWidget().getCaretOffset();                        						entry.viewer.getTextWidget().append(flist.getFormattedText());								if (entry.scroll) {							// Scroll to the bottom							viewer.setTopIndex(newDoc.getNumberOfLines());						}						else {							viewer.setTopIndex(topIndex);							viewer.getTextWidget().setCaretOffset(caret);							}					}				});			}		});				viewer.getTextWidget().addLineStyleListener(new LineStyleListener() {            public void lineGetStyle(LineStyleEvent event)            {            	for (Iterator iter = entry.filters.iterator(); iter.hasNext();) {                    Filter f = (Filter) iter.next();                    if (f.matches(event.lineText)) {                    	f.handleViewerMatch(event);	                    }                }            }        });                // Set the font.        Font f = LogwatcherPlugin.getDefault().getFont("logwatcherFont");        viewer.getTextWidget().setFont(f);        				watcher.start();			m_closeAction.setEnabled(true);		m_clearAction.setEnabled(true);		m_scrollAction.setEnabled(true);		m_editAction.setEnabled(true);				if (saveState) {			saveWatcherState();		}	}