本文整理汇总了Java中org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo类的典型用法代码示例。如果您正苦于以下问题:Java PropertyEditorFieldInfo类的具体用法?Java PropertyEditorFieldInfo怎么用?Java PropertyEditorFieldInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PropertyEditorFieldInfo类属于org.uberfire.ext.properties.editor.model包,在下文中一共展示了PropertyEditorFieldInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extractFieldInformationAndValues
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
private void extractFieldInformationAndValues(Class targetClass,
PropertyEditorCategory beanCategory,
Object instance) throws ErrorReadingFieldInformationAndValues {
for (Field declaredField : targetClass.getDeclaredFields()) {
PropertyEditorType type = PropertyEditorType.getFromType(declaredField.getType());
if (isAHandledType(type)) {
PropertyEditorFieldInfo field = createPropertyEditorInfo(instance,
declaredField,
type);
if (isACombo(field)) {
generateComboValues(declaredField,
field);
}
beanCategory.withField(field);
}
}
}
示例2: samplePlanBeanAndInstance_shouldGenerateCategoryAndValues
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
@Test
public void samplePlanBeanAndInstance_shouldGenerateCategoryAndValues() throws ClassNotFoundException {
BeanPropertyEditorBuilder builder = new BeanPropertyEditorBuilder();
PropertyEditorCategory category = builder.extract("org.uberfire.ext.properties.editor.server.beans.SamplePlanBean",
new SamplePlanBean("value1",
"value2"));
assertTrue(!category.getFields().isEmpty());
PropertyEditorFieldInfo field1 = category.getFields().get(0);
PropertyEditorFieldInfo fiedl2 = category.getFields().get(1);
assertProperty(field1,
"text1",
PropertyEditorType.TEXT,
"value1");
assertProperty(fiedl2,
"text2",
PropertyEditorType.TEXT,
"value2");
}
示例3: nullValuesOnInstanceShouldGenerateEmptyStrings
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
@Test
public void nullValuesOnInstanceShouldGenerateEmptyStrings() throws ClassNotFoundException {
BeanPropertyEditorBuilder builder = new BeanPropertyEditorBuilder();
PropertyEditorCategory category = builder.extract("org.uberfire.ext.properties.editor.server.beans.SamplePlanBean",
new SamplePlanBean(null,
null));
assertTrue(!category.getFields().isEmpty());
PropertyEditorFieldInfo field1 = category.getFields().get(0);
PropertyEditorFieldInfo fiedl2 = category.getFields().get(1);
assertProperty(field1,
"text1",
PropertyEditorType.TEXT,
"");
assertProperty(fiedl2,
"text2",
PropertyEditorType.TEXT,
"");
}
示例4: createRemoveAddOn
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
private static InputGroupButton createRemoveAddOn(final PropertyEditorFieldInfo field,
final PropertyEditorCategory category,
final PropertyEditorItemsWidget parent,
final Form categoryPanel) {
InputGroupButton groupButton = GWT.create(InputGroupButton.class);
Button button = GWT.create(Button.class);
button.setIcon(IconType.MINUS);
button.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
category.getFields().remove(field);
categoryPanel.remove(parent);
}
});
groupButton.add(button);
return groupButton;
}
示例5: widget
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
@Override
public Widget widget(final PropertyEditorFieldInfo property) {
final PropertyEditorColorPicker colorPicker = GWT.create(PropertyEditorColorPicker.class);
colorPicker.setValue(property.getCurrentStringValue());
colorPicker.addChangeHandler(
new ValueChangeHandler<String>() {
public void onValueChange(ValueChangeEvent event) {
String color = colorPicker.getValue();
if (validate(property,
color)) {
colorPicker.clearOldValidationErrors();
property.setCurrentStringValue(color);
propertyEditorChangeEvent.fire(new PropertyEditorChangeEvent(property,
color));
} else {
colorPicker.setValidationError(getValidatorErrorMessage(property,
color));
colorPicker.setValue(property.getCurrentStringValue());
}
}
});
return colorPicker;
}
示例6: addLostFocusHandler
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
private void addLostFocusHandler(final PropertyEditorFieldInfo property,
final PropertyEditorPasswordTextBox passwordTextBox) {
passwordTextBox.addBlurHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent event) {
if (validate(property,
passwordTextBox.getText())) {
passwordTextBox.clearOldValidationErrors();
property.setCurrentStringValue(passwordTextBox.getText());
propertyEditorChangeEventEvent.fire(new PropertyEditorChangeEvent(property,
passwordTextBox.getText()));
} else {
passwordTextBox.setValidationError(getValidatorErrorMessage(property,
passwordTextBox.getText()));
passwordTextBox.setText(property.getCurrentStringValue());
}
}
});
}
示例7: addKeyDownHandler
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
private void addKeyDownHandler(final PropertyEditorFieldInfo property,
final PropertyEditorPasswordTextBox passwordTextBox) {
passwordTextBox.addKeyDownHandler(new KeyDownHandler() {
@Override
public void onKeyDown(KeyDownEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
if (validate(property,
passwordTextBox.getText())) {
passwordTextBox.clearOldValidationErrors();
property.setCurrentStringValue(passwordTextBox.getText());
propertyEditorChangeEventEvent.fire(new PropertyEditorChangeEvent(property,
passwordTextBox.getText()));
} else {
passwordTextBox.setValidationError(getValidatorErrorMessage(property,
passwordTextBox.getText()));
passwordTextBox.setText(property.getCurrentStringValue());
}
}
}
});
}
示例8: widget
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
@Override
public Widget widget(final PropertyEditorFieldInfo property) {
final PropertyEditorComboBox listBox = GWT.create(PropertyEditorComboBox.class);
int index = 0;
int selected = -1;
for (String value : property.getComboValues()) {
listBox.addItem(value);
selected = searchSelectItem(property,
index,
selected,
value);
index++;
}
ifSelectedSelectItem(listBox,
index,
selected);
addChangeHandler(property,
listBox);
return listBox;
}
示例9: addChangeHandler
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
private void addChangeHandler(final PropertyEditorFieldInfo property,
final PropertyEditorComboBox listBox) {
listBox.addChangeHandler(new ChangeHandler() {
@Override
public void onChange(ChangeEvent event) {
int selectedIndex = listBox.getSelectedIndex();
if (validate(property,
listBox.getItemText(selectedIndex))) {
listBox.clearOldValidationErrors();
property.setCurrentStringValue(listBox.getItemText(selectedIndex));
propertyEditorChangeEventEvent.fire(new PropertyEditorChangeEvent(property,
listBox.getItemText(selectedIndex)));
} else {
listBox.setValidationError(getValidatorErrorMessage(property,
listBox.getItemText(selectedIndex)));
listBox.setSelectItemByText(property.getCurrentStringValue());
}
}
}
);
}
示例10: addLostFocusHandler
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
private void addLostFocusHandler(final PropertyEditorFieldInfo property,
final PropertyEditorTextBox textBox) {
textBox.addBlurHandler(new BlurHandler() {
@Override
public void onBlur(BlurEvent event) {
if (validate(property,
textBox.getText())) {
textBox.clearOldValidationErrors();
property.setCurrentStringValue(textBox.getText());
propertyEditorChangeEventEvent.fire(new PropertyEditorChangeEvent(property,
textBox.getText()));
} else {
textBox.setValidationError(getValidatorErrorMessage(property,
textBox.getText()));
textBox.setText(property.getCurrentStringValue());
}
}
});
}
示例11: addEnterKeyHandler
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
private void addEnterKeyHandler(final PropertyEditorFieldInfo property,
final PropertyEditorTextBox textBox) {
textBox.addKeyDownHandler(new KeyDownHandler() {
@Override
public void onKeyDown(KeyDownEvent event) {
if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
if (validate(property,
textBox.getText())) {
textBox.clearOldValidationErrors();
property.setCurrentStringValue(textBox.getText());
propertyEditorChangeEventEvent.fire(new PropertyEditorChangeEvent(property,
textBox.getText()));
} else {
textBox.setValidationError(getValidatorErrorMessage(property,
textBox.getText()));
textBox.setText(property.getCurrentStringValue());
}
}
}
});
}
示例12: widget
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
@Override
public Widget widget(final PropertyEditorFieldInfo property) {
final PropertyEditorCheckBox checkBox = GWT.create(PropertyEditorCheckBox.class);
checkBox.setValue(Boolean.parseBoolean(property.getCurrentStringValue()));
checkBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
public void onValueChange(ValueChangeEvent<Boolean> event) {
if (validate(property,
checkBox.getValue().toString())) {
checkBox.clearOldValidationErrors();
property.setCurrentStringValue(checkBox.getValue().toString());
propertyEditorChangeEventEvent.fire(new PropertyEditorChangeEvent(property,
checkBox.getValue().toString()));
} else {
checkBox.setValidationError(getValidatorErrorMessage(property,
checkBox.getValue().toString()));
checkBox.setValue(Boolean.valueOf(property.getCurrentStringValue()));
}
}
});
return checkBox;
}
示例13: isAMatchOfFilterTest
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
@Test
public void isAMatchOfFilterTest() {
PropertyEditorFieldInfo field = new PropertyEditorFieldInfo("label",
PropertyEditorType.TEXT);
assertTrue(PropertyEditorHelper.isAMatchOfFilter("l",
field));
assertTrue(PropertyEditorHelper.isAMatchOfFilter("label",
field));
assertTrue(PropertyEditorHelper.isAMatchOfFilter("LABEL",
field));
assertTrue(PropertyEditorHelper.isAMatchOfFilter("abel",
field));
assertFalse(PropertyEditorHelper.isAMatchOfFilter("LABELL",
field));
assertFalse(PropertyEditorHelper.isAMatchOfFilter("LASBELL",
field));
assertFalse(PropertyEditorHelper.isAMatchOfFilter("p",
field));
}
示例14: createPropertiesEditorCategory
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
private void createPropertiesEditorCategory() {
category = new PropertyEditorCategory("Properties");
category.setIdEvent(id);
for (Map.Entry<String, PropertyFormType> property : preference.getPropertiesTypes().entrySet()) {
final String propertyName = property.getKey();
final PropertyEditorType propertyType = getPropertyEditorType(property.getValue());
final Object propertyValue = preference.get(propertyName);
final PropertyEditorFieldInfo fieldInfo = createFieldInfo(propertyName,
propertyType,
propertyValue);
category.withField(fieldInfo);
}
}
示例15: createFieldInfo
import org.uberfire.ext.properties.editor.model.PropertyEditorFieldInfo; //导入依赖的package包/类
PropertyEditorFieldInfo createFieldInfo(final String propertyName,
final PropertyEditorType propertyType,
final Object propertyValue) {
final PropertyEditorFieldInfo fieldInfo = new PropertyEditorFieldInfo(translationService.format(hierarchyElement.getBundleKeyByProperty().get(propertyName)),
propertyValue != null ? propertyValue.toString() : "",
propertyType);
setupFieldValidators(propertyName,
fieldInfo);
setupFieldHelpText(propertyName,
fieldInfo);
setupFieldOptions(propertyName,
fieldInfo);
setupFieldKey(propertyName,
fieldInfo);
return fieldInfo;
}