use of com.google.gwt.user.client.ui.VerticalPanel 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);
}
}
use of com.google.gwt.user.client.ui.VerticalPanel in project rstudio by rstudio.
the class CreateKeyDialog method createMainWidget.
@Override
protected Widget createMainWidget() {
Styles styles = RESOURCES.styles();
VerticalPanel panel = new VerticalPanel();
panel.addStyleName(styles.mainWidget());
VerticalPanel namePanel = new VerticalPanel();
namePanel.setWidth("100%");
// path
CaptionWithHelp pathCaption = new CaptionWithHelp("The RSA key will be created at:", "SSH/RSA key management", "rsa_key_help");
pathCaption.setIncludeVersionInfo(false);
pathCaption.setWidth("100%");
namePanel.add(pathCaption);
TextBox txtKeyPath = new TextBox();
txtKeyPath.addStyleName(styles.keyPathTextBox());
txtKeyPath.setReadOnly(true);
txtKeyPath.setText(rsaSshKeyPath_.getPath());
txtKeyPath.setWidth("100%");
namePanel.add(txtKeyPath);
panel.add(namePanel);
HorizontalPanel passphrasePanel = new HorizontalPanel();
passphrasePanel.addStyleName(styles.newSection());
VerticalPanel passphrasePanel1 = new VerticalPanel();
Label passphraseLabel1 = new Label("Passphrase (optional):");
passphraseLabel1.addStyleName(styles.entryLabel());
passphrasePanel1.add(passphraseLabel1);
txtPassphrase_ = new PasswordTextBox();
txtPassphrase_.addStyleName(styles.passphrase());
passphrasePanel1.add(txtPassphrase_);
passphrasePanel.add(passphrasePanel1);
VerticalPanel passphrasePanel2 = new VerticalPanel();
passphrasePanel2.addStyleName(styles.lastSection());
Label passphraseLabel2 = new Label("Confirm:");
passphraseLabel2.addStyleName(styles.entryLabel());
passphrasePanel2.add(passphraseLabel2);
txtConfirmPassphrase_ = new PasswordTextBox();
txtConfirmPassphrase_.addStyleName(styles.passphraseConfirm());
passphrasePanel2.add(txtConfirmPassphrase_);
passphrasePanel.add(passphrasePanel2);
panel.add(passphrasePanel);
return panel;
}
use of com.google.gwt.user.client.ui.VerticalPanel in project rstudio by rstudio.
the class IgnoreDialog method createMainWidget.
@Override
protected Widget createMainWidget() {
VerticalPanel verticalPanel = new VerticalPanel();
verticalPanel.add(dirChooser_);
verticalPanel.add(ignoresCaption_);
final String aceWidth = "400px";
final String aceHeight = "300px";
Widget editorWidget = editor_.getWidget();
editorWidget.setSize(aceWidth, aceHeight);
SimplePanel panel = new SimplePanel();
panel.addStyleName(RES.styles().editorFrame());
panel.setSize(aceWidth, aceHeight);
panel.setWidget(editor_.getWidget());
verticalPanel.add(panel);
return verticalPanel;
}
use of com.google.gwt.user.client.ui.VerticalPanel in project rstudio by rstudio.
the class ExportPlotDialog method createMainWidget.
@Override
protected Widget createMainWidget() {
VerticalPanel mainPanel = new VerticalPanel();
// enforce maximum initial dimensions based on screen size
Size maxSize = new Size(Window.getClientWidth() - 100, Window.getClientHeight() - 200);
int width = Math.min(options_.getWidth(), maxSize.width);
int height = Math.min(options_.getHeight(), maxSize.height);
sizeEditor_ = new ExportPlotSizeEditor(width, height, options_.getKeepRatio(), createTopLeftWidget(), previewer_, new ExportPlotSizeEditor.Observer() {
@Override
public void onResized(boolean withMouse) {
if (!withMouse)
center();
}
});
mainPanel.add(sizeEditor_);
Widget bottomWidget = createBottomWidget();
if (bottomWidget != null)
mainPanel.add(bottomWidget);
return mainPanel;
}
use of com.google.gwt.user.client.ui.VerticalPanel in project rstudio by rstudio.
the class CompletionPopupPanel method showCompletionValues.
@Override
public void showCompletionValues(QualifiedName[] values, PositionCallback callback, boolean truncated) {
registerIgnoredKeys();
CompletionList<QualifiedName> list = new CompletionList<QualifiedName>(values, 6, true, true);
list.addSelectionCommitHandler(new SelectionCommitHandler<QualifiedName>() {
public void onSelectionCommit(SelectionCommitEvent<QualifiedName> event) {
lastSelectedValue_ = event.getSelectedItem();
SelectionCommitEvent.fire(CompletionPopupPanel.this, event.getSelectedItem());
}
});
list.addSelectionHandler(new SelectionHandler<QualifiedName>() {
public void onSelection(SelectionEvent<QualifiedName> event) {
lastSelectedValue_ = event.getSelectedItem();
SelectionEvent.fire(CompletionPopupPanel.this, event.getSelectedItem());
}
});
list_ = list;
container_ = new VerticalPanel();
container_.add(list_);
if (truncated)
container_.add(truncated_);
setWidget(container_);
ElementIds.assignElementId(list_.getElement(), ElementIds.POPUP_COMPLETIONS);
show(callback);
}
Aggregations