Beispiel #1
0
  /**
   * @param process the R process the controller belongs to
   * @param address the RMI address
   * @param initData the initialization data
   * @param embedded flag if running in embedded mode
   * @param startup flag to start R (otherwise connect only)
   * @param rArgs R arguments (required only if startup is <code>true</code>)
   * @param initialWD
   */
  public RjsController(
      final RProcess process,
      final RMIAddress address,
      final RjsConnection connection,
      final Map<String, Object> initData,
      final boolean embedded,
      final boolean startup,
      final String[] rArgs,
      final Map<String, Object> rjsProperties,
      final IFileStore initialWD,
      final RWorkspaceConfig workspaceConfig,
      final List<TrackingConfiguration> trackingConfigurations) {
    super(process, initData);
    if (address == null || connection == null) {
      throw new IllegalArgumentException();
    }
    process.registerFeatureSet(RTool.R_DATA_FEATURESET_ID);
    process.registerFeatureSet("de.walware.rj.services.RService"); // $NON-NLS-1$
    if (!embedded) {
      process.registerFeatureSet(IRemoteEngineController.FEATURE_SET_ID);
    }
    fAddress = address;
    fRjsConnection = connection;
    fEmbedded = embedded;
    fStartup = startup;
    fRArgs = rArgs;
    fRjsProperties = (rjsProperties != null) ? rjsProperties : new HashMap<String, Object>();

    fTrackingConfigurations = trackingConfigurations;

    fWorkspaceData =
        new RWorkspace(
            this,
            (embedded || address.isLocalHost()) ? null : address.getHostAddress().getHostAddress(),
            workspaceConfig);
    setWorkspaceDirL(initialWD);
    initRunnableAdapterL();
  }
 @Override
 public void setEnabled(final Object evaluationContext) {
   if (fProcess != null) {
     setBaseEnabled(!fProcess.isTerminated());
   }
 }