當前位置: 首頁>>代碼示例>>Java>>正文


Java TextArea.setText方法代碼示例

本文整理匯總了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());
	}
}
 
開發者ID:kuzavas,項目名稱:ephesoft,代碼行數:21,代碼來源:DependencyManagementPresenter.java

示例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;
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:20,代碼來源:MainFactoryActions.java

示例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);
}
 
開發者ID:muquit,項目名稱:gwtoauthlogindemo,代碼行數:24,代碼來源:GWTOAuthLoginDemo.java

示例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);
}
 
開發者ID:JetBrains,項目名稱:jetpad-projectional-open-source,代碼行數:17,代碼來源:ClipboardSupport.java

示例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();
}
 
開發者ID:ICT-BDA,項目名稱:EasyML,代碼行數:37,代碼來源:StdPanel.java

示例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 );
}
 
開發者ID:ICT-BDA,項目名稱:EasyML,代碼行數:12,代碼來源:SqlScriptParameterPanel.java

示例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());
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:14,代碼來源:GwtUtil.java

示例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());
    }

}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:24,代碼來源:TextAreaInputField.java

示例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;
}
 
開發者ID:qafedev,項目名稱:qafe-platform,代碼行數:30,代碼來源:MainFactoryActions.java

示例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);
}
 
開發者ID:Antokolos,項目名稱:iambookmaster,代碼行數:33,代碼來源:PlotEditor.java

示例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);
}
 
開發者ID:inepex,項目名稱:ineform,代碼行數:38,代碼來源:TransRowEditPopup.java

示例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 );
}
 
開發者ID:ICT-BDA,項目名稱:EasyML,代碼行數:35,代碼來源:ScriptParameterPanel.java

示例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;
}
 
開發者ID:ivan-zapreev,項目名稱:x-cure-chat,代碼行數:67,代碼來源:RoomInfoPopupPanel.java

示例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;
}
 
開發者ID:armangal,項目名稱:SmartMonitoring,代碼行數:7,代碼來源:ServerStatsPopup.java


注:本文中的com.google.gwt.user.client.ui.TextArea.setText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。