本文整理汇总了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;
}
示例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);
}
示例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;
}
示例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;
}