use of com.google.gwt.user.client.ui.TextArea in project rstudio by rstudio.
the class ShowPublicKeyDialog method createMainWidget.
@Override
protected Widget createMainWidget() {
VerticalPanel panel = new VerticalPanel();
int mod = BrowseCap.hasMetaKey() ? KeyboardShortcut.META : KeyboardShortcut.CTRL;
String cmdText = new KeyboardShortcut(mod, 'C').toString(true);
HTML label = new HTML("Press " + cmdText + " to copy the key to the clipboard");
label.addStyleName(RES.styles().viewPublicKeyLabel());
panel.add(label);
textArea_ = new TextArea();
textArea_.setReadOnly(true);
textArea_.setText(publicKey_);
textArea_.addStyleName(RES.styles().viewPublicKeyContent());
textArea_.setSize("400px", "250px");
textArea_.getElement().setAttribute("spellcheck", "false");
FontSizer.applyNormalFontSize(textArea_.getElement());
panel.add(textArea_);
return panel;
}
use of com.google.gwt.user.client.ui.TextArea in project gwt-test-utils by gwt-test-utils.
the class TextAreaTest method title.
@Test
public void title() {
// Given
TextArea t = new TextArea();
// Preconditions
assertThat(t.getTitle()).isEqualTo("");
// When
t.setTitle("title");
// Then
assertThat(t.getTitle()).isEqualTo("title");
}
use of com.google.gwt.user.client.ui.TextArea in project gwt-test-utils by gwt-test-utils.
the class TextAreaTest method text.
@Test
public void text() {
// Given
TextArea t = new TextArea();
// Preconditions
assertThat(t.getText()).isEqualTo("");
// When
t.setText("text");
// Then
assertThat(t.getText()).isEqualTo("text");
}
use of com.google.gwt.user.client.ui.TextArea in project gwt-test-utils by gwt-test-utils.
the class TextAreaTest method visible.
@Test
public void visible() {
// Given
TextArea t = new TextArea();
// Preconditions
assertThat(t.isVisible()).isEqualTo(true);
// When
t.setVisible(false);
// Then
assertThat(t.isVisible()).isEqualTo(false);
}
use of com.google.gwt.user.client.ui.TextArea in project gwt-test-utils by gwt-test-utils.
the class TextAreaTest method getCursorPos.
@Test
public void getCursorPos() {
// Given
TextArea t = new TextArea();
t.setText("myText");
GwtReflectionUtils.setPrivateFieldValue(t, "attached", true);
// When
t.setCursorPos(2);
// Then
assertThat(t.getCursorPos()).isEqualTo(2);
}
Aggregations