@Override public IStatus run(final IProgressMonitor monitor) throws OperationCanceledException { synchronized (this) { if (this.result == null) { this.result = new RHelpSearchResult(this); } this.result.init(this.query.getREnv()); } final IRHelpSearchRequestor requestor = new IRHelpSearchRequestor() { @Override public int maxFragments() { return PreferencesUtil.getInstancePrefs() .getPreferenceValue(RHelpPreferences.SEARCH_PREVIEW_FRAGMENTS_MAX_PREF); } @Override public void matchFound(final IRHelpSearchMatch match) { RHelpSearchUIQuery.this.result.addMatch(new RHelpSearchMatch(match)); } }; try { RCore.getRHelpManager().search(this.query, requestor, monitor); return Status.OK_STATUS; } catch (final CoreException e) { if (e.getStatus().getSeverity() == IStatus.CANCEL) { throw new OperationCanceledException(); } return new Status( IStatus.ERROR, RUI.PLUGIN_ID, "An error occurred when performing R help search: " + getSearchLabel()); } }
@Override protected SourceEditorViewerConfigurator createConfigurator(final SourceViewer sourceViewer) { final RSourceViewerConfigurator viewerConfigurator = new RSourceViewerConfigurator( RCore.getWorkbenchAccess(), new RSourceViewerConfiguration(null, SharedUIResources.getColors())); return viewerConfigurator; }
public ISourceUnitModelInfo getModelInfo( final String type, final int syncLevel, final IProgressMonitor monitor) { if (type == null || type.equals(RModel.TYPE_ID)) { if (syncLevel > IModelManager.NONE) { RCore.getRModelManager().reconcile(this, syncLevel, false, monitor); } return fModelInfo; } return null; }
public AstInfo<? extends IAstNode> getAstInfo( final String type, final boolean ensureSync, final IProgressMonitor monitor) { if (type == null || type.equals(RModel.TYPE_ID)) { if (ensureSync) { RCore.getRModelManager().reconcile(this, IModelManager.AST, false, monitor); } return fAst; } return null; }
@Override protected IModelManager getModelManager() { return RCore.getRModelManager(); }
public void reconcileRModel(final int reconcileLevel, final IProgressMonitor monitor) { RCore.getRModelManager().reconcile(this, reconcileLevel, true, monitor); }
@Override protected void unregister() { super.unregister(); RCore.getRModelManager().deregisterDependentUnit(this); }
public IRCoreAccess getRCoreAccess() { return RCore.getWorkbenchAccess(); }