Search in sources :

Example 41 with VerticalPanel

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);
    }
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) CheckBox(com.google.gwt.user.client.ui.CheckBox) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Label(com.google.gwt.user.client.ui.Label) SessionInfo(org.rstudio.studio.client.workbench.model.SessionInfo) TextBox(com.google.gwt.user.client.ui.TextBox) DirectoryChooserTextBox(org.rstudio.core.client.widget.DirectoryChooserTextBox) DirectoryChooserTextBox(org.rstudio.core.client.widget.DirectoryChooserTextBox) UIPrefs(org.rstudio.studio.client.workbench.prefs.model.UIPrefs)

Example 42 with VerticalPanel

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;
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) HorizontalPanel(com.google.gwt.user.client.ui.HorizontalPanel) Label(com.google.gwt.user.client.ui.Label) CaptionWithHelp(org.rstudio.core.client.widget.CaptionWithHelp) TextBox(com.google.gwt.user.client.ui.TextBox) PasswordTextBox(com.google.gwt.user.client.ui.PasswordTextBox) PasswordTextBox(com.google.gwt.user.client.ui.PasswordTextBox)

Example 43 with VerticalPanel

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;
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Widget(com.google.gwt.user.client.ui.Widget) SimplePanel(com.google.gwt.user.client.ui.SimplePanel)

Example 44 with 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;
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Size(org.rstudio.core.client.Size) Widget(com.google.gwt.user.client.ui.Widget)

Example 45 with VerticalPanel

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);
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) QualifiedName(org.rstudio.studio.client.workbench.views.console.shell.assist.CompletionRequester.QualifiedName)

Aggregations

VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)63 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)19 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)19 Label (com.google.gwt.user.client.ui.Label)18 HTML (com.google.gwt.user.client.ui.HTML)14 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)12 CheckBox (com.google.gwt.user.client.ui.CheckBox)9 SmallHeading (com.google.gerrit.client.ui.SmallHeading)7 Button (com.google.gwt.user.client.ui.Button)7 ScrollPanel (com.google.gwt.user.client.ui.ScrollPanel)7 TextBox (com.google.gwt.user.client.ui.TextBox)7 FlexTable (com.google.gwt.user.client.ui.FlexTable)6 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)6 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)6 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)5 OnEditEnabler (com.google.gerrit.client.ui.OnEditEnabler)4 Grid (com.google.gwt.user.client.ui.Grid)4 Image (com.google.gwt.user.client.ui.Image)4 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)4 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)4