本文整理汇总了Java中com.google.gwt.user.client.ui.TextArea类的典型用法代码示例。如果您正苦于以下问题:Java TextArea类的具体用法?Java TextArea怎么用?Java TextArea使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextArea类属于com.google.gwt.user.client.ui包,在下文中一共展示了TextArea类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: validateInput
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
private void validateInput() {
String value = "";
switch (inputType) {
case TEXTBOX:
value = ((TextBox)input).getValue();
break;
case TEXTAREA:
value = ((TextArea)input).getValue();
break;
case PASSWORD:
value = ((PasswordTextBox)input).getValue();
break;
}
if (isOptional && value.length() == 0) {
setInputValid(true);
} else {
if (validationStr != null) {
setInputValid(value.matches(validationStr));
} else {
setInputValid(true);
}
}
}
示例2: DocFieldWidget
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
public DocFieldWidget(String parentDocumentIdentifier, Label fieldLabel, Field field, ValidatableWidget<SuggestionBox> widget,
ValidatableWidget<ListBox> lWidget, ValidatableWidget<TextArea> textAreaWidget, boolean isReadOnly) {
this.parentDocumentIdentifier = parentDocumentIdentifier;
this.fieldLabel = fieldLabel;
this.field = field;
this.textAreaWidget = textAreaWidget;
this.widget = widget;
this.lWidget = lWidget;
this.isReadOnly = isReadOnly;
// enabling or disabling the widgets based on 'readonly' flag
if (lWidget != null) {
this.lWidget.getWidget().setEnabled(!isReadOnly);
}
if (widget != null) {
this.widget.getWidget().getTextBox().setEnabled(!isReadOnly);
}
if (textAreaWidget != null) {
this.textAreaWidget.getWidget().setReadOnly(isReadOnly);
}
setForceReviewOfValidatableWidget();
}
示例3: addCssStyle
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
/**
*
*/
private void addCssStyle() {
editDependencyPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
editDependencyPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
andButton.setSize(CustomWorkflowConstants._50PX, CustomWorkflowConstants._25PX);
orButton.setSize(CustomWorkflowConstants._50PX, CustomWorkflowConstants._25PX);
buttonsPanel.setSpacing(CustomWorkflowConstants.SPACING_15);
dependenciesList.setVisibleItemCount(CustomWorkflowConstants.VISIBLE_ITEM_10);
dependenciesListHorizontalPanel.add(dependenciesList);
dependenciesTextArea.setSize(CustomWorkflowConstants._280PX, CustomWorkflowConstants._147PX);
dependenciesTextArea.setTextAlignment(TextArea.ALIGN_JUSTIFY);
editDependencyDockLayoutPanel.addStyleName(CustomWorkflowConstants.CUSTOM_WORKFLOW_PANEL);
editDependencyDockLayoutPanel.addStyleName(CustomWorkflowConstants.MAIN_PANEL_LAYOUT);
pluginLabel.addStyleName(CustomWorkflowConstants.STRONG_LABEL);
dependencyTypeLabel.addStyleName(CustomWorkflowConstants.STRONG_LABEL);
dependenciesLabel.addStyleName(CustomWorkflowConstants.STRONG_LABEL);
pluginNamesList.addStyleName(CustomWorkflowConstants.STRONG_LABEL);
}
示例4: addToDependenciesList
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
public void addToDependenciesList(String dependencyType) {
String selectedDependency = getSelectedValueFromList(getEditDependencyPresenter().getView().getDependenciesList());
if (selectedDependency != null && !selectedDependency.isEmpty()) {
StringBuffer selectedDependencies = new StringBuffer(getEditDependencyPresenter().getView().getDependenciesTextArea()
.getText());
if (!selectedDependencies.toString().isEmpty()) {
if (dependencyType.equals(CustomWorkflowConstants.AND_SEPERATOR)) {
selectedDependencies.append(CustomWorkflowConstants.AND_SEPERATOR);
selectedDependencies.append(CustomWorkflowConstants.NEXT_LINE);
} else if (dependencyType.equals(CustomWorkflowConstants.OR_SEPERATOR)) {
selectedDependencies.append(CustomWorkflowConstants.OR_SEPERATOR);
selectedDependencies.append(CustomWorkflowConstants.NEXT_LINE);
}
}
selectedDependencies.append(selectedDependency);
TextArea dependenciesTextArea = editDependencyPresenter.getView().getDependenciesTextArea();
dependenciesTextArea.setText(selectedDependencies.toString());
dependenciesTextArea.setCursorPos(selectedDependencies.length());
}
}
示例5: createApplicationListener
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
@Override
public ApplicationListener createApplicationListener() {
setLoadingListener(new LoadingListener() {
@Override
public void beforeSetup() {}
@Override
public void afterSetup() {
textBox = new TextArea();
textBox.getElement().getStyle().setPosition(Style.Position.RELATIVE);
textBox.getElement().getStyle().setWidth(1000, Style.Unit.PX);
textBox.getElement().getStyle().setHeight(500, Style.Unit.PX);
textBox.getElement().getStyle().setDisplay(Style.Display.INLINE);
textBox.getElement().getStyle().setTop(50, Style.Unit.PX);
textBox.getElement().getStyle().setBackgroundColor("#664477");
textBox.setEnabled(true);
getRootPanel().add(textBox);
}
});
return new BabelBobble(new GwtCopier());
}
示例6: render
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
@Override
public Widget render(Schema property) {
HTMLPanel panel = new HTMLPanel("");
panel.getElement().getStyle().setDisplay(Display.INLINE);
panel.add(new InlineLabel("\""));
if (property.locked()) {
InlineLabel label = new InlineLabel();
panel.add(label);
hasText = label;
} else {
TextArea editor = new TextArea();
panel.add(editor);
hasText = editor;
}
panel.add(new InlineLabel("\""));
if (property.getDefault() != null) {
hasText.setText(property.getDefault());
}
return panel;
}
示例7: createXmlCallBack
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
private static AsyncCallback<?> createXmlCallBack(final TextArea textArea) {
if(xmlCallBack == null){
xmlCallBack = new AsyncCallback<Object>() {
public void onSuccess(Object result) {
if (result != null) {
String xml = result.toString();
textArea.setText(xml);
}
ClientApplicationContext.getInstance().setBusy(false);
}
public void onFailure(Throwable caught) {
ClientApplicationContext.getInstance().log("Processing screen creation failed", "Error creating dynamic panel", true, true, caught);
ClientApplicationContext.getInstance().setBusy(false);
updateTime(null);
}
};
}
return xmlCallBack;
}
示例8: Text
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
public Text(Composite parent, int style) {
this(new TextArea(), parent, style);
textArea = (TextArea) getGwtWidget();
panel = (LayoutPanel) getParent().getGwtWidget().getParent();
panel.add(textArea);
textArea.addBlurHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent event) {
setText(textArea.getText());
textArea.removeFromParent();
sendEvent(SWT.Modify);
sendEvent(SWT.FocusOut);
}
});
}
示例9: OriginalPanel
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
public OriginalPanel() {
setSize("100%", "100%");
setSpacing(5);
Label title = new Label(appConstants.importTextTitle());
add(title);
setCellWidth(title,"100%");
setCellHeight(title,"1%");
textArea = new TextArea();
textArea.addChangeListener(this);
textArea.setSize("100%","100%");
add(textArea);
setCellWidth(textArea,"100%");
setCellHeight(textArea,"99%");
}
示例10: createLuckyWikiButton
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
private void createLuckyWikiButton()
{
Anchor rndWikiButton = Anchor.wrap(Document.get().getElementById("btn_rnd_wiki"));
final TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text"));
rndWikiButton.addClickHandler(new ClickHandler()
{
public void onClick(ClickEvent event)
{
wcService.getRandomWikiUrl(new AsyncCallback<String>()
{
public void onSuccess(String result)
{
textArea.setText(result);
}
public void onFailure(Throwable caught)
{
textArea.setText("http://en.wikipedia.org/wiki/Special:random");
}
});
}
});
}
示例11: createLuckyTwitterButton
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
private void createLuckyTwitterButton()
{
Anchor rndWikiButton = Anchor.wrap(Document.get().getElementById("btn_rnd_twitter"));
final TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text"));
rndWikiButton.addClickHandler(new ClickHandler()
{
public void onClick(ClickEvent event)
{
wcService.getRandomTwitterUrl(new AsyncCallback<String>()
{
public void onSuccess(String result)
{
textArea.setText(result);
}
public void onFailure(Throwable caught)
{
textArea.setText("twitter: hot trend");
}
});
}
});
}
示例12: createLuckyYoutubeButton
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
private void createLuckyYoutubeButton()
{
Anchor rndWikiButton = Anchor.wrap(Document.get().getElementById("btn_rnd_youtube"));
final TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text"));
rndWikiButton.addClickHandler(new ClickHandler()
{
public void onClick(ClickEvent event)
{
wcService.getRandomYoutubeUrl(new AsyncCallback<String>()
{
public void onSuccess(String result)
{
textArea.setText(result);
}
public void onFailure(Throwable caught)
{
textArea.setText("https://www.youtube.com");
}
});
}
});
}
示例13: createLuckyGoogleButton
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
private void createLuckyGoogleButton()
{
Anchor rndGoogleButton = Anchor.wrap(Document.get().getElementById("btn_rnd_google"));
final TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text"));
rndGoogleButton.addClickHandler(new ClickHandler()
{
public void onClick(ClickEvent event)
{
wcService.getRandomGoogleUrl(new AsyncCallback<String>()
{
public void onSuccess(String result)
{
textArea.setText(result);
}
public void onFailure(Throwable caught)
{
textArea.setText("google: hot trend");
}
});
}
});
}
示例14: createTextArea
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
private TextArea createTextArea()
{
TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text"));
textArea.addKeyDownHandler(new KeyDownHandler()
{
public void onKeyDown(KeyDownEvent event)
{
event.preventDefault();
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER)
{
createWordCloud();
}
}
});
return textArea;
}
示例15: log
import com.google.gwt.user.client.ui.TextArea; //导入依赖的package包/类
public void log(String msg)
{
if (appScreen == null)
{
return;
}
TextArea logTextArea = appScreen.getTextArea();
Date d = new Date();
String t = d.toString() + ": " + msg;
int cW = logTextArea.getCharacterWidth();
String currentText = logTextArea.getText();
if (currentText.length() > 0)
{
logTextArea.setText(currentText + "\n" + t);
}
else
{
logTextArea.setText(t);
}
appScreen.getScrollPanel().scrollToBottom();
Log.debug(msg);
}