当前位置: 首页>>代码示例>>Java>>正文


Java TextArea.setReadOnly方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.TextArea.setReadOnly方法的典型用法代码示例。如果您正苦于以下问题:Java TextArea.setReadOnly方法的具体用法?Java TextArea.setReadOnly怎么用?Java TextArea.setReadOnly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.TextArea的用法示例。


在下文中一共展示了TextArea.setReadOnly方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

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

示例2: ConsoleDialog

import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
public ConsoleDialog(ConsoleDialogListener listener) {
	super(false, true);
	this.listener = listener;
	
       VerticalPanel dialogContents = new VerticalPanel();
       dialogContents.setSpacing(4);
       setWidget(dialogContents);
       
       console = new TextArea();
       console.setReadOnly(true);
       int width= Window.getClientWidth();
       int height= Window.getClientHeight();
       console.setSize(width*2/3 + "px", height*2/3   + "px");
       console.addStyleName(Utils.sandboxStyle.consoleArea());
       okButton = new Button("Ok");
       addButton(okButton);
       
       dialogContents.add(console);
       
       okButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			hide();
			if (ConsoleDialog.this.listener != null) {
				ConsoleDialog.this.listener.onOk(rpcCallSucceded && consoleSessionSucceded);
			}
		}
       });
       okButton.setEnabled(false);
}
 
开发者ID:kaaproject,项目名称:sandbox-frame,代码行数:31,代码来源:ConsoleDialog.java

示例3: onModuleLoad

import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
/**
 * This is the entry point method.
 */
@Override
public void onModuleLoad() {
    final TextArea log = new TextArea();
    RootPanel.get("log-div").add(log);
    log.addStyleName("logBox");
    log.setVisibleLines(10);
    log.setReadOnly(true);
    System.setOut(new TextAreaPrintStream(log));
    System.setErr(System.out);

    final Button runButton = new Button("Run!");
    RootPanel.get("btn-div").add(runButton);
    runButton.addStyleName("runButton");

    runButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            log.setValue("");
            String code = getSourceCode();
            String className = Javac.getClassName(code);

            boolean ok = Javac.compile(className + ".java", code);
            if (ok) {
                System.out.println("Compiled!");
                printMagic(fs.readFile(fs.cwd() + className + ".class"));
                System.out.println("Output:");

                JVM.setClassLoader(new JibClassLoader());
                JVM.run(className);
            }
        }
    });
}
 
开发者ID:ctalau,项目名称:javainthebrowser,代码行数:37,代码来源:Jib.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

示例6: setReadOnly

import com.google.gwt.user.client.ui.TextArea; //导入方法依赖的package包/类
@Override
public void setReadOnly(boolean readOnly) {
	super.setReadOnly(readOnly);
	TextArea textArea = ((TextArea) this.field);
	textArea.setReadOnly(readOnly);
}
 
开发者ID:fhcampuswien,项目名称:atom,代码行数:7,代码来源:StringLobView.java


注:本文中的com.google.gwt.user.client.ui.TextArea.setReadOnly方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。