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