Package com.smartgwt.client.data.fields

Examples of com.smartgwt.client.data.fields.DataSourceIntegerField


    // @extract-start CustomAttributeFormFieldRegistry, CustomAttributeFormFieldRegistry
    // We define the custom type "myType" in the AttributeFormItemFactory:
    AttributeFormFieldRegistry.registerCustomFormItem("myType", new DataSourceFieldFactory() {

      public DataSourceField create() {
        return new DataSourceIntegerField();
      }
    }, new FormItemFactory() {

      public FormItem create() {
        return new SliderItem();
View Full Code Here


    @Override
    protected List<DataSourceField> addDataSourceFields() {
        List<DataSourceField> fields = super.addDataSourceFields();

        DataSourceField idField = new DataSourceIntegerField("id", MSG.common_title_id(), 50);
        idField.setPrimaryKey(true);
        idField.setCanEdit(false);
        idField.setHidden(true);
        fields.add(idField);

        return fields;
    }
View Full Code Here

    @Override
    protected List<DataSourceField> addDataSourceFields() {
        List<DataSourceField> fields = super.addDataSourceFields();

        DataSourceIntegerField idField = new DataSourceIntegerField(Field.ID, MSG.common_title_id());
        idField.setPrimaryKey(true);
        fields.add(idField);

        DataSourceTextField nameField = new DataSourceTextField(Field.OPERATION_NAME, MSG
            .dataSource_operationHistory_field_operationName());
        fields.add(nameField);
View Full Code Here

        return textField;
    }

    protected static DataSourceIntegerField createIntegerField(String name, String title, Integer minValue,
        Integer maxValue, Boolean required) {
        DataSourceIntegerField textField = new DataSourceIntegerField(name, title);
        textField.setRequired(required);
        if (minValue != null || maxValue != null) {
            IntegerRangeValidator integerRangeValidator = new IntegerRangeValidator();
            if (minValue != null) {
                integerRangeValidator.setMin(minValue);
            } else {
                integerRangeValidator.setMin(Integer.MIN_VALUE);
            }
            if (maxValue != null) {
                integerRangeValidator.setMax(maxValue);
            } else {
                integerRangeValidator.setMax(Integer.MAX_VALUE);
            }

            textField.setValidators(integerRangeValidator);
        }
        return textField;
    }
View Full Code Here

    @Override
    protected List<DataSourceField> addDataSourceFields() {
        List<DataSourceField> fields = super.addDataSourceFields();

        DataSourceField idDataField = new DataSourceIntegerField("id", MSG.common_title_id(), 20);
        idDataField.setPrimaryKey(true);
        fields.add(idDataField);

        DataSourceTextField nameDataField = new DataSourceTextField(NAME.propertyName(), NAME.title(), 200);
        fields.add(nameDataField);
View Full Code Here

            MSG.dataSource_traits_field_primaryKey());
        primaryKeyField.setPrimaryKey(true);
        primaryKeyField.setHidden(true);
        fields.add(primaryKeyField);

        DataSourceIntegerField idField = new DataSourceIntegerField(FIELD_METRIC_SCHED_ID, MSG.dataSource_traits_field_definitionID());
        idField.setHidden(true);
        fields.add(idField);

        DataSourceIntegerField nameField = new DataSourceIntegerField(FIELD_METRIC_NAME, MSG.common_title_name());
        nameField.setHidden(true);
        fields.add(nameField);

        return fields;
    }
View Full Code Here

    @Override
    protected List<DataSourceField> addDataSourceFields() {
        List<DataSourceField> fields = super.addDataSourceFields();

        DataSourceField idDataField = new DataSourceIntegerField("id", MSG.common_title_id(), 50);
        idDataField.setPrimaryKey(true);
        idDataField.setCanEdit(false);
        fields.add(idDataField);

        DataSourceTextField nameDataField = new DataSourceTextField(NAME.propertyName(), NAME.title(), 200);
        nameDataField.setCanEdit(false);
        fields.add(nameDataField);
View Full Code Here

    @Override
    protected List<DataSourceField> addDataSourceFields() {
        List<DataSourceField> fields = super.addDataSourceFields();

        DataSourceIntegerField idField = new DataSourceIntegerField(FIELD_ID, MSG.common_title_id());
        idField.setPrimaryKey(true);
        fields.add(idField);

        DataSourceTextField nameField = new DataSourceTextField(FIELD_NAME, MSG.common_title_name());
        fields.add(nameField);
View Full Code Here

    @Override
    protected List<DataSourceField> addDataSourceFields() {
        List<DataSourceField> fields = super.addDataSourceFields();

        DataSourceIntegerField idField = new DataSourceIntegerField(FIELD_ID, MSG.common_title_id());
        idField.setPrimaryKey(true);
        fields.add(idField);

        DataSourceTextField name = new DataSourceTextField(FIELD_NAME, MSG.common_title_name());
        fields.add(name);
View Full Code Here

    // TODO: i18n
    @Override
    protected List<DataSourceField> addDataSourceFields() {
        List<DataSourceField> fields = super.addDataSourceFields();

        DataSourceIntegerField idField = new DataSourceIntegerField(Field.ID, MSG
            .dataSource_operationSchedule_field_id());
        idField.setPrimaryKey(true);
        idField.setCanEdit(false);
        fields.add(idField);

        DataSourceTextField operationNameField = createTextField(Field.OPERATION_NAME, MSG
            .dataSource_operationSchedule_field_operationName(), null, 100, true);
        // sort the op def names in the drop down
        TreeSet<OperationDefinition> operationDefinitions = new TreeSet<OperationDefinition>(
            new Comparator<OperationDefinition>() {
                public int compare(OperationDefinition o1, OperationDefinition o2) {
                    return o1.getDisplayName().compareTo(o2.getDisplayName());
                }
            });
        operationDefinitions.addAll(this.resourceType.getOperationDefinitions());
        LinkedHashMap<String, String> valueMap = new LinkedHashMap<String, String>();
        for (OperationDefinition operationDefinition : operationDefinitions) {
            valueMap.put(operationDefinition.getName(), operationDefinition.getDisplayName());
        }
        operationNameField.setValueMap(valueMap);
        fields.add(operationNameField);

        DataSourceTextField operationDisplayNameField = createTextField(Field.OPERATION_DISPLAY_NAME, MSG
            .dataSource_operationSchedule_field_operationDisplayName(), null, 100, true);
        fields.add(operationDisplayNameField);

        DataSourceField subjectField = new DataSourceField(Field.SUBJECT, FieldType.ANY, MSG.common_title_owner());
        subjectField.setCanEdit(false);
        fields.add(subjectField);

        DataSourceTextField descriptionField = createTextField(Field.DESCRIPTION, MSG
            .dataSource_operationSchedule_field_description(), null, 100, false);
        fields.add(descriptionField);

        DataSourceDateTimeField nextFireTimeField = new DataSourceDateTimeField(Field.NEXT_FIRE_TIME, MSG
            .dataSource_operationSchedule_field_nextFireTime());
        nextFireTimeField.setCanEdit(false);
        fields.add(nextFireTimeField);

        DataSourceIntegerField timeoutField = createIntegerField(Field.TIMEOUT, MSG
            .dataSource_operationSchedule_field_timeout(), 30, null, false);
        fields.add(timeoutField);

        return fields;
    }
View Full Code Here

TOP

Related Classes of com.smartgwt.client.data.fields.DataSourceIntegerField

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.