if(fetchLogEntriesJob == null) { fetchLogEntriesJob = new FetchLogEntriesJob(); }
IPreferenceStore store = SVNUIPlugin.getPlugin().getPreferenceStore(); int entriesToFetch = store.getInt(ISVNUIConstants.PREF_LOG_ENTRIES_TO_FETCH); if (entriesToFetch > 0) fetchLogEntriesJob = new FetchLogEntriesJob(); else fetchLogEntriesJob = new FetchAllLogEntriesJob();
  protected void createTableHistory(Composite parent) {    this.historyTableProvider = new HistoryTableProvider();    this.tableHistoryViewer = historyTableProvider.createTable(parent);    // set the content provider for the table    this.tableHistoryViewer.setContentProvider(new IStructuredContentProvider() {      public Object[] getElements(Object inputElement) {        // Short-circuit to optimize        if(entries != null)          return entries;        if( !(inputElement instanceof ISVNRemoteResource))          return null;        final ISVNRemoteResource remoteResource = (ISVNRemoteResource) inputElement;        if(fetchLogEntriesJob == null) {          fetchLogEntriesJob = new FetchLogEntriesJob();        }        if(fetchLogEntriesJob.getState() != Job.NONE) {          fetchLogEntriesJob.cancel();          try {            fetchLogEntriesJob.join();          } catch(InterruptedException e) {            SVNUIPlugin.log(new SVNException(                Policy.bind("HistoryView.errorFetchingEntries", remoteResource.getName()), e)); //$NON-NLS-1$          }        }        fetchLogEntriesJob.setRemoteFile(remoteResource);        Utils.schedule(fetchLogEntriesJob, SVNUIPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow()            .getActivePage().getActivePart().getSite());        return new Object[ 0];      }      public void dispose() {      }      public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {        entries = null;        lastEntry = null;        revisionStart = SVNRevision.HEAD;      }    });    // set the selectionchanged listener for the table    // updates the comments and affected paths when selection changes    this.tableHistoryViewer.addSelectionChangedListener(new ISelectionChangedListener() {      private ILogEntry currentLogEntry;      public void selectionChanged(SelectionChangedEvent event) {        ISelection selection = event.getSelection();        ILogEntry logEntry = getLogEntry((IStructuredSelection) selection);        if(logEntry != currentLogEntry) {          this.currentLogEntry = logEntry;          updatePanels(selection);        }        SVNHistoryPage.this.selection = selection;      }    });    // Double click open action    this.tableHistoryViewer.getTable().addListener(SWT.DefaultSelection, new Listener() {      public void handleEvent(Event e) {        getOpenRemoteFileAction().run();      }    });    // Contribute actions to popup menu for the table    {      MenuManager menuMgr = new MenuManager();      Menu menu = menuMgr.createContextMenu(tableHistoryViewer.getTable());      menuMgr.addMenuListener(new IMenuListener() {        public void menuAboutToShow(IMenuManager menuMgr) {          fillTableMenu(menuMgr);        }      });      menuMgr.setRemoveAllWhenShown(true);      tableHistoryViewer.getTable().setMenu(menu);      getHistoryPageSite().getPart().getSite().registerContextMenu(menuMgr, tableHistoryViewer);    }  }