Search in sources :

Example 1 with RProjectVcsOptions

use of org.rstudio.studio.client.projects.model.RProjectVcsOptions in project rstudio by rstudio.

the class ProjectSourceControlPreferencesPane method initialize.

@Override
protected void initialize(RProjectOptions options) {
    // save the context
    vcsContext_ = options.getVcsContext();
    // populate the vcs selections list
    String[] vcsSelections = new String[] { NONE };
    JsArrayString applicableVcs = vcsContext_.getApplicableVcs();
    if (applicableVcs.length() > 0) {
        vcsSelections = new String[applicableVcs.length() + 1];
        vcsSelections[0] = NONE;
        for (int i = 0; i < applicableVcs.length(); i++) vcsSelections[i + 1] = applicableVcs.get(i);
    }
    vcsSelect_.setChoices(vcsSelections);
    // set override or default
    RProjectVcsOptions vcsOptions = options.getVcsOptions();
    if (vcsOptions.getActiveVcsOverride().length() > 0)
        setVcsSelection(vcsOptions.getActiveVcsOverride());
    else
        setVcsSelection(vcsContext_.getDetectedVcs());
}
Also used : RProjectVcsOptions(org.rstudio.studio.client.projects.model.RProjectVcsOptions) JsArrayString(com.google.gwt.core.client.JsArrayString) JsArrayString(com.google.gwt.core.client.JsArrayString)

Example 2 with RProjectVcsOptions

use of org.rstudio.studio.client.projects.model.RProjectVcsOptions in project rstudio by rstudio.

the class ProjectSourceControlPreferencesPane method onApply.

@Override
public boolean onApply(RProjectOptions options) {
    RProjectVcsOptions vcsOptions = options.getVcsOptions();
    setVcsOptions(vcsOptions);
    return false;
}
Also used : RProjectVcsOptions(org.rstudio.studio.client.projects.model.RProjectVcsOptions)

Aggregations

RProjectVcsOptions (org.rstudio.studio.client.projects.model.RProjectVcsOptions)2 JsArrayString (com.google.gwt.core.client.JsArrayString)1