use of org.rstudio.core.client.widget.DirectoryChooserTextBox in project rstudio by rstudio.
the class VersionControlPage method onAddWidgets.
@Override
protected void onAddWidgets() {
NewProjectResources.Styles styles = NewProjectResources.INSTANCE.styles();
VerticalPanel urlPanel = new VerticalPanel();
urlPanel.addStyleName(styles.wizardMainColumn());
Label urlLabel = new Label("Repository URL:");
urlLabel.addStyleName(styles.wizardTextEntryLabel());
urlPanel.add(urlLabel);
txtRepoUrl_ = new TextBox();
txtRepoUrl_.addDomHandler(new KeyDownHandler() {
public void onKeyDown(KeyDownEvent event) {
handleAutoFillCheckoutDir();
}
}, KeyDownEvent.getType());
txtRepoUrl_.setWidth("100%");
urlPanel.add(txtRepoUrl_);
addWidget(urlPanel);
addSpacer();
txtUsername_ = new TextBox();
txtUsername_.setWidth("100%");
if (includeCredentials()) {
VerticalPanel usernamePanel = new VerticalPanel();
usernamePanel.addStyleName(styles.wizardMainColumn());
Label usernameLabel = new Label("Username (if required for this repository URL):");
usernameLabel.addStyleName(styles.wizardTextEntryLabel());
usernamePanel.add(usernameLabel);
usernamePanel.add(txtUsername_);
addWidget(usernamePanel);
addSpacer();
}
Label dirNameLabel = new Label("Project directory name:");
dirNameLabel.addStyleName(styles.wizardTextEntryLabel());
addWidget(dirNameLabel);
txtDirName_ = new TextBox();
txtDirName_.addValueChangeHandler(new ValueChangeHandler<String>() {
@Override
public void onValueChange(ValueChangeEvent<String> event) {
if (!event.getValue().equals(guessRepoDir()))
suppressDirNameDetection_ = true;
}
});
txtDirName_.addStyleName(styles.wizardMainColumn());
addWidget(txtDirName_);
addSpacer();
existingRepoDestDir_ = new DirectoryChooserTextBox("Create project as subdirectory of:", txtRepoUrl_);
addWidget(existingRepoDestDir_);
}
use of org.rstudio.core.client.widget.DirectoryChooserTextBox in project rstudio by rstudio.
the class ExistingDirectoryPage method onAddWidgets.
@Override
protected void onAddWidgets() {
existingProjectDir_ = new DirectoryChooserTextBox("Project working directory:", null);
addWidget(existingProjectDir_);
}
use of org.rstudio.core.client.widget.DirectoryChooserTextBox in project rstudio by rstudio.
the class NewDirectoryPage method onAddWidgets.
@Override
protected void onAddWidgets() {
NewProjectResources.Styles styles = NewProjectResources.INSTANCE.styles();
HorizontalPanel panel = new HorizontalPanel();
panel.addStyleName(styles.wizardMainColumn());
// create the dir name label
dirNameLabel_ = new Label("Directory name:");
dirNameLabel_.addStyleName(styles.wizardTextEntryLabel());
// top panel widgets
onAddTopPanelWidgets(panel);
// dir name
VerticalPanel namePanel = new VerticalPanel();
namePanel.addStyleName(styles.newProjectDirectoryName());
namePanel.add(dirNameLabel_);
txtProjectName_ = new TextBox();
txtProjectName_.setWidth("100%");
txtProjectName_.getElement().setAttribute("spellcheck", "false");
namePanel.add(txtProjectName_);
panel.add(namePanel);
addWidget(panel);
onAddBodyWidgets();
addSpacer();
// project dir
newProjectParent_ = new DirectoryChooserTextBox("Create project as subdirectory of:", txtProjectName_);
addWidget(newProjectParent_);
// if git is available then add git init
UIPrefs uiPrefs = RStudioGinjector.INSTANCE.getUIPrefs();
SessionInfo sessionInfo = RStudioGinjector.INSTANCE.getSession().getSessionInfo();
HorizontalPanel optionsPanel = null;
if (getOptionsSideBySide())
optionsPanel = new HorizontalPanel();
chkGitInit_ = new CheckBox("Create a git repository");
chkGitInit_.addStyleName(styles.wizardCheckbox());
if (sessionInfo.isVcsAvailable(VCSConstants.GIT_ID)) {
chkGitInit_.setValue(uiPrefs.newProjGitInit().getValue());
chkGitInit_.getElement().getStyle().setMarginRight(7, Unit.PX);
if (optionsPanel != null) {
optionsPanel.add(chkGitInit_);
} else {
addSpacer();
addWidget(chkGitInit_);
}
}
// Initialize project with packrat
chkPackratInit_ = new CheckBox("Use packrat with this project");
chkPackratInit_.setValue(uiPrefs.newProjUsePackrat().getValue());
if (!sessionInfo.getPackratAvailable()) {
chkPackratInit_.setValue(false);
chkPackratInit_.setVisible(false);
}
if (optionsPanel != null) {
optionsPanel.add(chkPackratInit_);
} else {
addSpacer();
addWidget(chkPackratInit_);
}
if (optionsPanel != null) {
addSpacer();
addWidget(optionsPanel);
}
}
Aggregations