本文整理汇总了Java中com.google.gwt.user.client.ui.TextArea.setText方法的典型用法代码示例。如果您正苦于以下问题:Java TextArea.setText方法的具体用法?Java TextArea.setText怎么用?Java TextArea.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.TextArea
的用法示例。
在下文中一共展示了TextArea.setText方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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());
}
}
示例2: 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;
}
示例3: 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);
}
示例4: copyContent
import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
public void copyContent(ClipboardContent content) {
final TextArea copyArea = createClipboardTextArea();
if (TextContentHelper.isText(content)) {
copyArea.setText(TextContentHelper.getText(content));
} else {
copyArea.setText(content.toString());
}
copyArea.selectAll();
new Timer() {
@Override
public void run() {
RootPanel.get().remove(copyArea);
$(myTarget).focus();
}
}.schedule(20);
}
示例5: init
import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
protected void init(String msg, String title) {
this.setTitle("stdErr");
this.setGlassEnabled(true);
HTML closeButton = new HTML("X");
closeButton.setSize("10px", "10px");
closeButton.setStyleName("closebtn");
closeButton.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
StdPanel.this.hide();
}
});
ScrollPanel scvp = new ScrollPanel();
VerticalPanel verticalPanel = new VerticalPanel();
verticalPanel.add(closeButton);
verticalPanel.setCellHeight(closeButton, "30px");
verticalPanel.setStyleName("vpanel");
HTML desc = new HTML(title);
desc.setStyleName("popupTitle");
verticalPanel.add(desc);
verticalPanel.setCellHeight(desc, "30px");
TextArea label = new TextArea();
label.setText(msg);
label.setReadOnly(true);
label.setSize("650px", "400px");
verticalPanel.add(label);
scvp.add(verticalPanel);
this.add(scvp);
this.setStyleName("loading_container");
this.center();
this.show();
}
示例6: init
import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
/**
* Init UI
* @param editable Wheather is editable
*/
protected void init(boolean editable){
scriptArea = new TextArea();
scriptArea.setText( widget.getProgramConf().getScriptContent());
this.add( panel );
this.add( new Label("Script"));
this.add( scriptArea );
}
示例7: showDebugMsgBox
import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
public static void showDebugMsgBox(final String msg) {
if (_debugMsgBoxPopup == null) {
_debugMsgBox = new TextArea();
ScrollPanel wrapper = new ScrollPanel(_debugMsgBox);
wrapper.setSize("300px", "200px");
_debugMsgBoxPopup = new PopupPane("Debug", wrapper, false, false);
_debugMsgBox.setCharacterWidth(2000);
_debugMsgBox.setVisibleLines(10);
}
_debugMsgBox.setText(_debugMsgBox.getText() + "\n" + msg);
if (!_debugMsgBoxPopup.isVisible()) _debugMsgBoxPopup.show();
_debugMsgBox.getElement().setScrollTop(_debugMsgBox.getElement().getScrollHeight());
}
示例8: TextAreaInputField
import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
/**
* Use this constructor only when you are subclassing TextAreaFieldWidget and need
* the special case provided by the willEncapsulate parameter.
* @param fieldDef the FieldDef that is the Model for this TextAreaFieldWidget
* @param willEncapsulate this parameter should be true only if you are subclassing
* text box and plan to wrap it in another widget. If true, you must call
* initWidget() in the subclass and TextAreaFieldWidget will not call it.
* This parameter is rarely used
*/
protected TextAreaInputField(FieldDef fieldDef, boolean willEncapsulate) {
_fieldDef = fieldDef;
_textArea = new TextArea();
_textArea.setSize("250px", "135px");
addHandlers();
if (!willEncapsulate)initWidget(_textArea);
_textArea.setTitle(_fieldDef.getShortDesc());
if (_fieldDef.getDefaultValueAsString() != null) {
_textArea.setText(_fieldDef.getDefaultValueAsString());
}
}
示例9: 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);
DialogComponent
.showDialog(
"Conversion successful",
"Please select from the menu of this window the \"GWT\" rendering option. <br>A \"Try Me\" menu item will appear in the top menu bar. <br><br> All the windows from this FMB will be listed. ",
GenericDialogGVO.TYPE_INFO,
"Please select from the menu of this window the \"GWT output\" rendering option. <br>A \"Try Me\" menu item will appear in the top menu bar. <br><br> All the windows from this FMB will be listed in this \"Try Me\" menu. ",
0, 0);
}
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;
}
示例10: PlotEditor
import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
public PlotEditor(Model mod) {
this.model = mod;
setSize("100%", "100%");
plot = new TextArea();
plot.setSize("100%", "100%");
plot.setText(model.getPlot());
plot.addChangeHandler(new ChangeHandler() {
public void onChange(ChangeEvent event) {
model.updatePlot(plot.getText().trim(), plotListener);
}
});
add(plot);
setCellHeight(plot,"100%");
setCellWidth(plot,"100%");
plotListener = new PlotListener() {
public void refreshAll() {
plot.setText(model.getPlot());
}
public void update(String pl) {
plot.setText(pl);
}
public void updateBookRules(String rules) {
}
public void updatePlayerRules(String rules) {
}
public void updateCommercialText(String text) {
}
public void updateDemoInfoText(String text) {
}
};
model.addPlotListener(plotListener);
}
示例11: DialogContent
import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
public DialogContent(EditCallback callback) {
this.callback = callback;
VerticalPanel vp = new VerticalPanel();
initWidget(vp);
if (engVal != null && !engVal.equals("")) {
vp.add(new Label(translatorappI18n.translateTableRow_engVal()));
HTML lbl = new HTML(perNToBr(SafeHtmlUtils.htmlEscape(brToPerN(engVal))));
lbl.getElement().getStyle().setBackgroundColor("#f2f2f2");
lbl.getElement().getStyle().setWidth(blockWidth, Unit.PX);
lbl.getElement().getStyle().setHeight(blockHeight, Unit.PX);
lbl.getElement().getStyle().setOverflowY(Overflow.AUTO);
lbl.getElement().getStyle().setBorderColor("#d0d0d0");
lbl.getElement().getStyle().setBorderStyle(BorderStyle.SOLID);
lbl.getElement().getStyle().setBorderWidth(2, Unit.PX);
vp.add(lbl);
}
vp.add(new Label(translatorappI18n.translatedValue_value()));
textArea = new TextArea();
textArea.setText(brToPerN(translatedVal));
textArea.getElement().getStyle().setWidth(blockWidth, Unit.PX);
textArea.getElement().getStyle().setHeight(blockHeight, Unit.PX);
vp.add(textArea);
HorizontalPanel hp = new HorizontalPanel();
hp.setSpacing(10);
revertBtn = new IneButton(IneButtonType.CANCEL, IneFormI18n.CANCEL());
hp.add(revertBtn);
doneBtn = new IneButton(IneButtonType.ACTION, IneFormI18n.SAVE());
hp.add(doneBtn);
vp.add(hp);
}
示例12: init
import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
/**
* Init UI
* @param editable Wheather is editable
*/
protected void init(boolean editable){
initGridHead( 3 );
inCountBox = new TextBox();
outCountBox = new TextBox();
inCountBox.setText( "" +widget.getInNodeShapes().size() );
outCountBox.setText( "" + widget.getOutNodeShapes().size());
paramsGrid.setVisible(true);
paramsGrid.setWidget( 1 , 0, new Label("Input File Number"));
paramsGrid.setWidget( 1, 1, new Label("Int"));
paramsGrid.setWidget( 1, 2, inCountBox );
inCountBox.setSize("95%", "100%");
inCountBox.setStyleName("okTextbox");
inCountBox.setEnabled(editable);
inCountBox.setTabIndex(0);
paramsGrid.setWidget( 2 , 0, new Label("Output File Number"));
paramsGrid.setWidget( 2, 1, new Label("Int"));
paramsGrid.setWidget( 2 , 2, outCountBox );
outCountBox.setSize("95%", "100%");
outCountBox.setStyleName("okTextbox");
outCountBox.setEnabled(editable);
outCountBox.setTabIndex(1);
scriptArea = new TextArea();
scriptArea.setText( widget.getProgramConf().getScriptContent());
this.add( paramsGrid );
this.add( new Label("Script"));
this.add( scriptArea );
}
示例13: addFieldLabel
import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
/**
* Add a field name/field value label to the bodyGrid
* @param text the text to insert
* @param isName true if the text is the name of the field
* @partam isAlognNameTop true if we need to align the name to the top of the cell
* this parameter only works if isName == true
* @param isLongValue true if it is a long value, then is it
* inserted into TextArea.of width 16 characters
* @param listener the click listener for the hyperlink (user name)
* @return the created widget that is the name of value field
*/
private Widget addFieldLabel(final String text, final boolean isName,
final boolean isAlognNameTop,
final boolean isLongValue,
final ClickHandler listener) {
Widget element = null;
if( isName ){
bodyGrid.insertRow( row );
bodyGrid.insertCell( row, column );
Label lab = new Label( text + FIELD_NAME_VS_VALUE_DELIMITER );
lab.setWordWrap(false);
lab.setStyleName( CommonResourcesContainer.INFO_POPUP_FIELD_NAME_STYLE_NAME );
bodyGrid.setWidget( row, column, lab );
if( isAlognNameTop ) {
bodyGrid.getCellFormatter().setVerticalAlignment( row, column, HasVerticalAlignment.ALIGN_TOP);
}
column += 1;
//Assign the return value
element = lab;
} else {
//The long value is placed into a disabled textarea
if( isLongValue ){
//We will insert the long data on the new row, but place an empty cell for the old position
bodyGrid.insertCell( row, column );
bodyGrid.insertRow( ++row ); column = 0;
bodyGrid.insertCell( row, column++ );
bodyGrid.insertCell( row, column ); column = 0;
TextArea area = new TextArea();
//Set the line length in characters
area.setCharacterWidth( MAX_DESCRIPTION_AREA_WIDTH_SYMB );
area.setReadOnly( true );
final String roomDescText = StringUtils.formatTextWidth( MAX_DESCRIPTION_AREA_WIDTH_SYMB, text, true );
area.setText( roomDescText );
//Set the number of visible lines
area.setVisibleLines( StringUtils.countLines( roomDescText ) );
element = area;
bodyGrid.getFlexCellFormatter().setColSpan( row , column, 2);
} else {
bodyGrid.insertCell( row, column );
element = new Label( text );
}
bodyGrid.getCellFormatter().setHorizontalAlignment( row, column, HasHorizontalAlignment.ALIGN_RIGHT);
if( (listener != null) && ( element instanceof Label ) ){
Label label = (Label) element;
label.setWordWrap(false);
label.addClickHandler( listener );
label.setStyleName( CommonResourcesContainer.INFO_POPUP_VALUE_LINK_STYLE_NAME );
} else {
element.setStyleName( CommonResourcesContainer.INFO_POPUP_VALUE_STYLE_NAME );
}
bodyGrid.setWidget( row, column, element );
row +=1;
column = 0;
}
return element;
}
示例14: getWrappedHtml
import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
private Widget getWrappedHtml(String text) {
TextArea ta = new TextArea();
ta.setText(text);
ta.setSize("700px", "100px");
return ta;
}