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


Java TextBox.setReadOnly方法代码示例

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


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

示例1: addTextBox

import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
/**
 * To add Text Box.
 * 
 * @param row int
 * @param value String
 * @param dataType DataType
 * @param readOnly boolean
 * @return ValidatableWidget<TextBox>
 */
public ValidatableWidget<TextBox> addTextBox(int row, String value, DataType dataType, boolean readOnly) {
	TextBox fieldValue = new TextBox();
	fieldValue.setReadOnly(readOnly);
	fieldValue.setText(value);
	final ValidatableWidget<TextBox> validatableTextBox = new ValidatableWidget<TextBox>(fieldValue);
	if (!readOnly) {
		validatableTextBox.addValidator((Validator) ValidatorFactory.getValidator(dataType, fieldValue));
		validatableTextBox.getWidget().addValueChangeHandler(new ValueChangeHandler<String>() {

			@Override
			public void onValueChange(ValueChangeEvent<String> event) {
				validatableTextBox.toggleValidDateBox();
			}
		});
		validatableTextBox.toggleValidDateBox();
	}

	return validatableTextBox;
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:29,代码来源:KV_PP_EditView.java

示例2: AdditionalChoicePropertyEditor

import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
/**
 * Creates a new additional choice dialog.
 */
protected AdditionalChoicePropertyEditor() {
  summary = new TextBox();
  summary.setReadOnly(true);
  summary.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
      openAdditionalChoiceDialog();
    }
  });

  initWidget(summary);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:16,代码来源:AdditionalChoicePropertyEditor.java

示例3: addTextBox

import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
/**
 * To add Text Box.
 * 
 * @param row int
 * @param dto BatchClassPluginConfigDTO
 * @param readOnly boolean
 * @return ValidatableWidget<TextBox>
 */
public ValidatableWidget<TextBox> addTextBox(int row, final BatchClassPluginConfigDTO dto, boolean readOnly) {
	TextBox fieldValue = new TextBox();
	fieldValue.setReadOnly(readOnly);
	fieldValue.setWidth("160px");
	fieldValue.setName(dto.getPluginConfig().getFieldName());
	fieldValue.setText(dto.getValue());
	final ValidatableWidget<TextBox> validatableTextBox = new ValidatableWidget<TextBox>(fieldValue);
	if (!readOnly && dto.getPluginConfig() != null) {
		validatableTextBox.addValidator((Validator) ValidatorFactory.getValidator(dto.getDataType(), fieldValue));

		validatableTextBox.getWidget().addValueChangeHandler(new ValueChangeHandler<String>() {

			@Override
			public void onValueChange(ValueChangeEvent<String> event) {
				if (!dto.isMandatory() && validatableTextBox.getWidget().getText().isEmpty()) {
					validatableTextBox.getWidget().removeStyleName(AdminConstants.DATE_BOX_FORMAT_ERROR);
				} else {
					validatableTextBox.toggleValidDateBox();
				}
			}
		});

		if (!dto.isMandatory() && validatableTextBox.getWidget().getText().isEmpty()) {
			validatableTextBox.getWidget().removeStyleName(AdminConstants.DATE_BOX_FORMAT_ERROR);
		} else {
			validatableTextBox.toggleValidDateBox();
		}

		if (dto.isMandatory()) {
			validatableTextBox.addValidator(new EmptyStringValidator(validatableTextBox.getWidget()));
		}

	}

	return validatableTextBox;
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:45,代码来源:EditPluginView.java

示例4: addTextBox

import com.google.gwt.user.client.ui.TextBox; //导入方法依赖的package包/类
/**
 * To add text box.
 * 
 * @param row int
 * @param value String
 * @param dataType String
 * @param readOnly boolean
 * @param isMandatory boolean
 * @param htmlID String
 * @param elementMap Map<String, Widget>
 * @return ValidatableWidget<TextBox>
 */
public ValidatableWidget<TextBox> addTextBox(int row, String value, String dataType, boolean readOnly, boolean isMandatory,
		String htmlID, Map<String, Widget> elementMap) {
	TextBox fieldValue = new TextBox();
	elementMap.put(htmlID, fieldValue);
	fieldValue.setReadOnly(readOnly);
	fieldValue.setText(value);
	scrollPanel.setStyleName(AdminConstants.SCROLL_PANEL_HEIGHT);

	final ValidatableWidget<TextBox> validatableTextBox = new ValidatableWidget<TextBox>(fieldValue);
	if (!readOnly && dataType != null && DataType.getValuesAsListString().contains(dataType.toLowerCase())) {
		validatableTextBox.addValidator((Validator) ValidatorFactory.getValidator(DataType.getDataType(dataType.toUpperCase()),
				fieldValue));
		validatableTextBox.getWidget().addValueChangeHandler(new ValueChangeHandler<String>() {

			@Override
			public void onValueChange(ValueChangeEvent<String> event) {
				validatableTextBox.toggleValidDateBox();
			}
		});
		validatableTextBox.toggleValidDateBox();
	}
	if (isMandatory) {
		validatableTextBox.addValidator(new EmptyStringValidator(fieldValue));
		validatableTextBox.toggleValidDateBox();
	}

	return validatableTextBox;
}
 
开发者ID:kuzavas,项目名称:ephesoft,代码行数:41,代码来源:EditScannerView.java


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