當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。