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


Java TextArea.setCharacterWidth方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.TextArea.setCharacterWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java TextArea.setCharacterWidth方法的具體用法?Java TextArea.setCharacterWidth怎麽用?Java TextArea.setCharacterWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.ui.TextArea的用法示例。


在下文中一共展示了TextArea.setCharacterWidth方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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

示例2: onModuleLoad

import com.google.gwt.user.client.ui.TextArea; //導入方法依賴的package包/類
public void onModuleLoad() {
    // create the widgets
    final Button analyseButton = new Button(messages.sendButton());
    final Button configureButton = new Button(messages.configureButton());
    final TextArea mainTextArea = new TextArea();
    mainTextArea.setCharacterWidth(80);
    mainTextArea.setVisibleLines(15);
    final Label errorLabel = new Label();
    final CellTable<SnomedConcept> resultsTable = new CellTable<>();

    // add them to the root panel
    RootPanel.get("mainTextArea").add(mainTextArea);
    RootPanel.get("analyseButton").add(analyseButton);
    RootPanel.get("configureButton").add(configureButton);
    RootPanel.get("status").add(errorLabel);
    RootPanel.get("snomedCodes").add(resultsTable);

    // set the focus to the text area
    mainTextArea.setFocus(true);

    // initialise the SNOMED code results table
    final List<SnomedConcept> conceptList = configSnomedTable(resultsTable);

    // add the handlers
    final List<SemanticType> types = new ArrayList<>();
    final Map<String, String> typeCodeToDescription = new HashMap<>();
    analyseButton.addClickHandler(
            new AnalyseHandler(mainTextArea, errorLabel, conceptList, types, typeCodeToDescription));
    configureButton.addClickHandler(new ConfigureHandler(types, typeCodeToDescription));
}
 
開發者ID:NICTA,項目名稱:t3as-snomedct-service,代碼行數:31,代碼來源:SnomedCoderUi.java

示例3: TextAreaExample

import com.google.gwt.user.client.ui.TextArea; //導入方法依賴的package包/類
public TextAreaExample() {
  super("Text Area");

  TextArea text = new TextArea();
  text.setCharacterWidth(30);
  text.setVisibleLines(5);
  add(text);

  RichTextArea rich = new RichTextArea();
  rich.setHTML("Rich <i>text</i> <b>area</b>");
  add(rich);
}
 
開發者ID:DavidWhitlock,項目名稱:PortlandStateJava,代碼行數:13,代碼來源:TextAreaExample.java

示例4: initTextArea

import com.google.gwt.user.client.ui.TextArea; //導入方法依賴的package包/類
/**
 * Initialisation code for the TextAreas
 *
 * @param area text area to initialise
 */
private void initTextArea(TextArea area) {
  area.setReadOnly(true);
  area.setVisibleLines(40);
  area.setCharacterWidth(80);
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:11,代碼來源:DebugDialog.java

示例5: 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


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