当前位置: 首页>>代码示例>>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;未经允许,请勿转载。