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;
}
}
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_);
}
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);
}
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;
}
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();
}
});
}
Aggregations