Search in sources :

Example 11 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project rstudio by rstudio.

the class VersionControlPage method acceptNavigation.

@Override
protected boolean acceptNavigation() {
    SessionInfo sessionInfo = RStudioGinjector.INSTANCE.getSession().getSessionInfo();
    if (!sessionInfo.isVcsAvailable(getVcsId())) {
        NewProjectResources.Styles styles = NewProjectResources.INSTANCE.styles();
        VerticalPanel verticalPanel = new VerticalPanel();
        verticalPanel.addStyleName(styles.vcsNotInstalledWidget());
        if (Desktop.isDesktop()) {
            HTML msg = new HTML("<p>" + getTitle() + " was not detected " + "on the system path.</p>" + "<p>To create projects from " + getTitle() + " " + "repositories you should install " + getTitle() + " " + "and then restart RStudio.</p>" + "<p>Note that if " + getTitle() + " is installed " + "and not on the path, then you can specify its location using " + "the " + (BrowseCap.isMacintosh() ? "Preferences" : "Options") + " dialog.</p>");
            msg.setWidth("100%");
            verticalPanel.add(msg);
            HelpLink vcsHelpLink = new VcsHelpLink();
            vcsHelpLink.setCaption("Using " + getTitle() + " with RStudio");
            vcsHelpLink.addStyleName(styles.vcsHelpLink());
            verticalPanel.add(vcsHelpLink);
        } else {
            HTML msg = new HTML("<p>An installation of " + getTitle() + " was not detected " + "on this system.</p>" + "<p>To create projects from " + getTitle() + " " + "repositories you should request that your server " + "administrator install the " + getTitle() + " package.</p>");
            msg.setWidth("100%");
            verticalPanel.add(msg);
        }
        MessageDialog dlg = new MessageDialog(MessageDialog.INFO, getTitle() + " Not Found", verticalPanel);
        dlg.addButton("OK", (Operation) null, true, false);
        dlg.showModal();
        return false;
    } else {
        return true;
    }
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) HelpLink(org.rstudio.studio.client.common.HelpLink) VcsHelpLink(org.rstudio.studio.client.common.vcs.VcsHelpLink) SessionInfo(org.rstudio.studio.client.workbench.model.SessionInfo) HTML(com.google.gwt.user.client.ui.HTML) MessageDialog(org.rstudio.core.client.widget.MessageDialog) VcsHelpLink(org.rstudio.studio.client.common.vcs.VcsHelpLink)

Example 12 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel 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_);
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) KeyDownEvent(com.google.gwt.event.dom.client.KeyDownEvent) KeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler) Label(com.google.gwt.user.client.ui.Label) TextBox(com.google.gwt.user.client.ui.TextBox) DirectoryChooserTextBox(org.rstudio.core.client.widget.DirectoryChooserTextBox) DirectoryChooserTextBox(org.rstudio.core.client.widget.DirectoryChooserTextBox)

Example 13 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project rstudio by rstudio.

the class ProjectPackratPreferencesPane method initialize.

@Override
protected void initialize(RProjectOptions options) {
    Styles styles = RES.styles();
    Label label = new Label("Packrat is a dependency management tool that makes your " + "R code more isolated, portable, and reproducible by " + "giving your project its own privately managed package " + "library.");
    spaced(label);
    add(label);
    PackratContext context = options.getPackratContext();
    RProjectPackratOptions packratOptions = options.getPackratOptions();
    chkUsePackrat_ = new CheckBox("Use packrat with this project");
    chkUsePackrat_.setValue(context.isPackified());
    chkUsePackrat_.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

        @Override
        public void onValueChange(ValueChangeEvent<Boolean> event) {
            if (event.getValue())
                verifyPrerequisites();
            else
                manageUI(false);
        }
    });
    spaced(chkUsePackrat_);
    add(chkUsePackrat_);
    chkAutoSnapshot_ = new CheckBox("Automatically snapshot local changes");
    chkAutoSnapshot_.setValue(packratOptions.getAutoSnapshot());
    lessSpaced(chkAutoSnapshot_);
    add(chkAutoSnapshot_);
    String vcsName = session_.getSessionInfo().getVcsName();
    chkVcsIgnoreLib_ = new CheckBox(vcsName + " ignore packrat library");
    chkVcsIgnoreLib_.setValue(packratOptions.getVcsIgnoreLib());
    lessSpaced(chkVcsIgnoreLib_);
    add(chkVcsIgnoreLib_);
    chkVcsIgnoreSrc_ = new CheckBox(vcsName + " ignore packrat sources");
    chkVcsIgnoreSrc_.setValue(packratOptions.getVcsIgnoreSrc());
    lessSpaced(chkVcsIgnoreSrc_);
    add(chkVcsIgnoreSrc_);
    chkUseCache_ = new CheckBox("Use global cache for installed packages");
    chkUseCache_.setValue(packratOptions.getUseCache());
    spaced(chkUseCache_);
    add(chkUseCache_);
    panelExternalPackages_ = new VerticalPanel();
    panelExternalPackages_.add(new LabelWithHelp("External packages (comma separated):", "packrat_external_packages", false));
    taExternalPackages_ = new FixedTextArea(3);
    taExternalPackages_.addStyleName(styles.externalPackages());
    taExternalPackages_.setText(StringUtil.join(Arrays.asList(JsUtil.toStringArray(packratOptions.getExternalPackages())), ", "));
    taExternalPackages_.getElement().getStyle().setMarginBottom(8, Unit.PX);
    panelExternalPackages_.add(taExternalPackages_);
    add(panelExternalPackages_);
    widgetLocalRepos_ = new LocalRepositoriesWidget();
    String[] localRepos = JsUtil.toStringArray(packratOptions.getLocalRepos());
    for (int i = 0; i < localRepos.length; ++i) {
        widgetLocalRepos_.addItem(localRepos[i]);
    }
    add(widgetLocalRepos_);
    manageUI(context.isPackified());
    HelpLink helpLink = new HelpLink("Learn more about Packrat", "packrat", false);
    helpLink.getElement().getStyle().setMarginTop(15, Unit.PX);
    nudgeRight(helpLink);
    add(helpLink);
}
Also used : RProjectPackratOptions(org.rstudio.studio.client.projects.model.RProjectPackratOptions) LabelWithHelp(org.rstudio.core.client.widget.LabelWithHelp) Label(com.google.gwt.user.client.ui.Label) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) CheckBox(com.google.gwt.user.client.ui.CheckBox) FixedTextArea(org.rstudio.core.client.widget.FixedTextArea) LocalRepositoriesWidget(org.rstudio.core.client.widget.LocalRepositoriesWidget) HelpLink(org.rstudio.studio.client.common.HelpLink) PackratContext(org.rstudio.studio.client.packrat.model.PackratContext)

Example 14 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project rstudio by rstudio.

the class CodeSearchDialog method createMainWidget.

@Override
protected Widget createMainWidget() {
    VerticalPanel mainPanel = new VerticalPanel();
    mainPanel.addStyleName(CodeSearchResources.INSTANCE.styles().codeSearchDialogMainWidget());
    codeSearch_ = pCodeSearch_.get();
    codeSearch_.setObserver(this);
    mainPanel.add(codeSearch_.getSearchWidget());
    return mainPanel;
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel)

Example 15 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project opennms by OpenNMS.

the class VSearchBox method onLoad.

@Override
public void onLoad() {
    m_componentHolder.clear();
    this.setStyleName("topology-search");
    final TextBoxBase textField = new TextBox();
    textField.setWidth("245px");
    textField.setStyleName("topology-search-box");
    textField.getElement().setAttribute("placeholder", "Search...");
    textField.setFocus(true);
    RemoteSuggestOracle oracle = new RemoteSuggestOracle();
    m_suggestBox = new SuggestBox(oracle, textField);
    m_suggestBox.addSelectionHandler(new SelectionHandler<SuggestOracle.Suggestion>() {

        @Override
        public void onSelection(SelectionEvent<SuggestOracle.Suggestion> event) {
            SearchSuggestion selectedItem = (SearchSuggestion) event.getSelectedItem();
            textField.setText("");
            m_connector.addToFocus(selectedItem);
        }
    });
    if (m_isMultiValued) {
        m_suggestBox.setStyleName("multivalue");
    }
    m_suggestBox.addStyleName("wideTextField");
    m_suggestBox.addSelectionHandler(this);
    m_suggestBox.addKeyUpHandler(this);
    m_componentHolder.setWidth("245px");
    m_componentHolder.add(m_suggestBox);
    if (m_focusedContainer == null) {
        m_focusedContainer = new VerticalPanel();
        m_scrollContainer = new FlowPanel();
        m_scrollContainer.add(m_focusedContainer);
    }
    m_focusedContainer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    m_focusedContainer.setTitle("Focused Vertices");
    m_componentHolder.add(m_scrollContainer);
    Timer timer = new Timer() {

        @Override
        public void run() {
            updateScrollPanelSize();
        }
    };
    timer.schedule(1000);
    m_windowResizeRegistration = Window.addResizeHandler(new ResizeHandler() {

        @Override
        public void onResize(ResizeEvent event) {
            updateScrollPanelSize();
        }
    });
}
Also used : TextBox(com.google.gwt.user.client.ui.TextBox) TextBoxBase(com.google.gwt.user.client.ui.TextBoxBase) ResizeEvent(com.google.gwt.event.logical.shared.ResizeEvent) SuggestBox(com.google.gwt.user.client.ui.SuggestBox) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Timer(com.google.gwt.user.client.Timer) ResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler) FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Aggregations

VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)49 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)16 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)16 Label (com.google.gwt.user.client.ui.Label)15 HTML (com.google.gwt.user.client.ui.HTML)12 CheckBox (com.google.gwt.user.client.ui.CheckBox)9 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)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 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)5 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)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 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)4 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)4 VoidResult (com.google.gerrit.client.VoidResult)3