예제 #1
0
  private void checkInit(final int flags, final RService r, final IProgressMonitor monitor)
      throws CoreException {
    if ((flags & INITIAL) == INITIAL || fRPlatform == null) {
      checkRVersion(r.getPlatform());

      final IREnvConfiguration config = fREnv.getConfig();
      if (config != null && config.isRemote()) {
        fRLibGroups = REnvLibGroups.loadFromR(r, monitor);
      }
    }
  }
예제 #2
0
  public RPkgManager(final IREnvConfiguration rConfig) {
    fREnv = rConfig.getReference();
    fREnvDirectory = EFS.getLocalFileSystem().getStore(REnvConfiguration.getStateLocation(fREnv));
    final String qualifier = ((AbstractPreferencesModelObject) rConfig).getNodeQualifiers()[0];
    fSelectedReposPref = new RRepoListPref(qualifier, "RPkg.Repos.repos"); // $NON-NLS-1$
    fSelectedCRANPref = new RRepoPref(qualifier, "RPkg.CRANMirror.repo"); // $NON-NLS-1$
    fBioCVersionPref = new StringPref2(qualifier, "RPkg.BioCVersion.ver"); // $NON-NLS-1$
    fSelectedBioCPref = new RRepoPref(qualifier, "RPkg.BioCMirror.repo"); // $NON-NLS-1$

    final IPreferenceAccess prefs = PreferencesUtil.getInstancePrefs();
    fAddRepos = new ArrayList<>();
    if (rConfig.getType() == IREnvConfiguration.USER_LOCAL_TYPE) {
      final String rjVersion =
          "" + ServerUtil.RJ_VERSION[0] + '.' + ServerUtil.RJ_VERSION[1]; // $NON-NLS-1$
      fAddRepos.add(
          new RRepo(
              RRepo.SPECIAL_PREFIX + "rj",
              "RJ",
              "http://download.walware.de/rj-" + rjVersion,
              null)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }
    fSelectedRepos =
        new SelectedRepos(
            prefs.getPreferenceValue(fSelectedReposPref),
            prefs.getPreferenceValue(fSelectedCRANPref),
            prefs.getPreferenceValue(fBioCVersionPref),
            prefs.getPreferenceValue(fSelectedBioCPref));

    fDB = DB.create(fREnv, fREnvDirectory);
    fCache = new Cache(fREnvDirectory);
    resetPkgs(rConfig);

    fFirstTime = true;
    fMirrorsStamp = fPkgsStamp = System.currentTimeMillis();
    fRequireLoad |= (REQUIRE_CRAN | REQUIRE_BIOC | REQUIRE_REPOS);
    fRequireLoad |= (REQUIRE_REPO_PKGS | REQUIRE_INST_PKGS);

    PreferencesUtil.getSettingsChangeNotifier().addManageListener(this);

    getWriteLock().lock();
    try {
      loadPrefs(true);
    } finally {
      getWriteLock().unlock();
    }
  }
예제 #3
0
 private void resetPkgs(final IREnvConfiguration config) {
   fPkgsExt = null;
   if (fDB != null && config != null) {
     fPkgsLight = fDB.loadPkgs(config.getRLibraryGroups());
   }
   if (fPkgsLight == null) {
     fDB = null;
     fPkgsLight = new RPkgSet(0);
   }
 }