use of com.google.gwt.user.client.ui.TextBox 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();
}
});
}
use of com.google.gwt.user.client.ui.TextBox in project gerrit by GerritCodeReview.
the class ProjectInfoScreen method getPluginConfigValues.
private Map<String, Map<String, ConfigParameterValue>> getPluginConfigValues() {
Map<String, Map<String, ConfigParameterValue>> pluginConfigValues = new HashMap<>(pluginConfigWidgets.size());
for (Entry<String, Map<String, HasEnabled>> e : pluginConfigWidgets.entrySet()) {
Map<String, ConfigParameterValue> values = new HashMap<>(e.getValue().size());
pluginConfigValues.put(e.getKey(), values);
for (Entry<String, HasEnabled> e2 : e.getValue().entrySet()) {
HasEnabled widget = e2.getValue();
if (widget instanceof TextBox) {
values.put(e2.getKey(), ConfigParameterValue.create().value(((TextBox) widget).getValue().trim()));
} else if (widget instanceof CheckBox) {
values.put(e2.getKey(), ConfigParameterValue.create().value(Boolean.toString(((CheckBox) widget).getValue())));
} else if (widget instanceof ListBox) {
ListBox listBox = (ListBox) widget;
// the inherited value is at index 0,
// if it is selected no value should be set on this project
String value = listBox.getSelectedIndex() > 0 ? listBox.getValue(listBox.getSelectedIndex()) : null;
values.put(e2.getKey(), ConfigParameterValue.create().value(value));
} else if (widget instanceof StringListPanel) {
values.put(e2.getKey(), ConfigParameterValue.create().values(((StringListPanel) widget).getValues(0).toArray(new String[] {})));
} else {
throw new UnsupportedOperationException("unsupported widget type");
}
}
}
return pluginConfigValues;
}
use of com.google.gwt.user.client.ui.TextBox in project rstudio by rstudio.
the class FileBrowserWidget method createTopWidget.
// Private methods ---------------------------------------------------------
private Widget createTopWidget() {
String nameLabel = host_.getFilenameLabel();
if (nameLabel == null)
return null;
HorizontalPanel filenamePanel = new HorizontalPanel();
FileDialogStyles styles = FileDialogResources.INSTANCE.styles();
filenamePanel.setStylePrimaryName(styles.filenamePanel());
filenamePanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);
Label filenameLabel = new Label(nameLabel + ":", false);
filenameLabel.setStylePrimaryName(styles.filenameLabel());
filenamePanel.add(filenameLabel);
filename_ = new TextBox();
if (initialFilename_ != null)
filename_.setText(initialFilename_);
filename_.setStylePrimaryName(styles.filename());
filenamePanel.add(filename_);
filenamePanel.setCellWidth(filename_, "100%");
ftm_ = new FocusTransitionManager();
ftm_.add(filename_, directory_);
return filenamePanel;
}
use of com.google.gwt.user.client.ui.TextBox in project rstudio by rstudio.
the class ExportPlotSizeEditor method createImageSizeTextBox.
private TextBox createImageSizeTextBox() {
TextBox textBox = new TextBox();
textBox.setStylePrimaryName(ExportPlotResources.INSTANCE.styles().imageSizeTextBox());
return textBox;
}
use of com.google.gwt.user.client.ui.TextBox 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_);
}
Aggregations