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


Java PropertyEditorFieldInfo类代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:BeanPropertyEditorBuilder.java

示例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");
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:BeanPropertyEditorBuilderTest.java

示例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,
                   "");
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:BeanPropertyEditorBuilderTest.java

示例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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:PropertyEditorHelper.java

示例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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:ColorField.java

示例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());
            }
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:SecretTextField.java

示例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());
                }
            }
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:SecretTextField.java

示例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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:ComboField.java

示例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());
                                     }
                                 }
                             }

    );
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:ComboField.java

示例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());
            }
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:TextField.java

示例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());
                }
            }
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:TextField.java

示例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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:BooleanField.java

示例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));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:PropertyEditorHelperTest.java

示例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);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:DefaultPreferenceForm.java

示例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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:DefaultPreferenceForm.java


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