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


Java FormItem类代码示例

本文整理汇总了Java中com.smartgwt.client.widgets.form.fields.FormItem的典型用法代码示例。如果您正苦于以下问题:Java FormItem类的具体用法?Java FormItem怎么用?Java FormItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FormItem类属于com.smartgwt.client.widgets.form.fields包,在下文中一共展示了FormItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: focusInputField

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
void focusInputField(final FormItem focusItem) {

        Scheduler.get().scheduleDeferred( new Scheduler.ScheduledCommand() {

            @Override
            public void execute() {
                // Reset the search field for next time
                focusItem.focusInItem();
            }

        });
        
        // DeferredCommand.addCommand(new Command() {
        //     public void execute() {
        //         // Reset the search field for next time
        //         focusItem.focusInItem();
        //     }
        // });
        
    }
 
开发者ID:will-gilbert,项目名称:OSWf-OSWorkflow-fork,代码行数:21,代码来源:ActorView.java

示例2: focusInputField

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
void focusInputField(final FormItem focusItem) {
    Scheduler.get().scheduleDeferred( new Scheduler.ScheduledCommand() {

        @Override
        public void execute() {
            // Reset the search field for next time
            focusItem.focusInItem();
        }

    });
    
    // DeferredCommand.addCommand(new Command() {
    //     public void execute() {
    //         // Reset the search field for next time
    //         focusItem.focusInItem();
    //     }
    // });
    
}
 
开发者ID:will-gilbert,项目名称:OSWf-OSWorkflow-fork,代码行数:20,代码来源:InputsView.java

示例3: createItem

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
public FormItem createItem(final Field f, final String lang) {
    ItemType itemType = getType(f);
    FormItem formItem = null;
    switch (itemType) {
        case PLAIN:
            formItem = getFormItem(f, lang);
            break;
        case ARRAY:
            // XXX replace StringFormFactory with a generic type solution
            formItem = new RepeatableFormItem(f,
                    new StringFormFactory(f.getName(), f.getTitle(lang), false));
            break;
        case FORM:
            formItem = createNestedFormItem(f, lang);
            break;
        case CUSTOM_FORM:
            formItem = createNestedCustomFormItem(f, lang);
            break;
    }
    return customizeFormItem(formItem, f);
}
 
开发者ID:proarc,项目名称:proarc,代码行数:22,代码来源:FormGenerator.java

示例4: setOptionDataSource

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
private void setOptionDataSource(FormItem item, Field f, String lang) {
    Field optionField = f.getOptionDataSource();
    DataSource ds = ValueMapDataSource.getInstance().getOptionDataSource(optionField.getName());
    item.setValueField(f.getOptionValueField()[0]);
    item.setOptionDataSource(ds);

    setPickListValueMapping(item, f);

    Integer pickListWidth = getWidthAsInteger(optionField.getWidth());
    if (item instanceof SelectItem) {
        SelectItem selectItem = (SelectItem) item;
        selectItem.setPickListFields(getPickListFields(optionField, lang));
        if (pickListWidth != null) {
            selectItem.setPickListWidth(pickListWidth);
        }
    } else if (item instanceof ComboBoxItem) {
        ComboBoxItem cbi = (ComboBoxItem) item;
        cbi.setPickListFields(getPickListFields(optionField, lang));
        if (pickListWidth != null) {
            cbi.setPickListWidth(pickListWidth);
        }
    }
}
 
开发者ID:proarc,项目名称:proarc,代码行数:24,代码来源:FormGenerator.java

示例5: customizeFormItem

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
/**
 * Adds common properties to simple {@link #getFormItem items}.
 */
public FormItem customizeFormItem(FormItem item, Field f) {
    if (item.getTitle() == null) {
        item.setShowTitle(false);
    }
    item.setRequired(f.getRequired());
    item.setPrompt(f.getHint(activeLocale));
    item.setHoverWidth(defaultHoverWidth);
    if (f.getHidden() != null && f.getHidden()) {
        item.setVisible(false);
    }
    String width = f.getWidth();
    if (width != null) {
        item.setWidth(width);
    }
    if (f.getHeight() != null) {
        item.setHeight(f.getHeight());
    }
    if (f.getReadOnly() != null && f.getReadOnly()) {
        item.setCanEdit(!f.getReadOnly());
    }
    return item;
}
 
开发者ID:proarc,项目名称:proarc,代码行数:26,代码来源:FormGenerator.java

示例6: getFormItem

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
public FormItem getFormItem(Field f, String lang) {
    FormItem formItem;
    String type = f.getType();
    if (Field.TEXT.equals(type)) {
        formItem = getTextFormItem(f, lang);
    } else if (Field.TEXTAREA.equals(type)) {
        formItem = getTextAreaFormItem(f, lang);
    } else if (Field.G_YEAR.equals(type)) {
        formItem = getDateYearFormItem(f, lang);
    } else if (Field.DATE.equals(type)) {
        formItem = getDateFormItem(f, lang);
    } else if (Field.COMBO.equals(type)) {
        formItem = getComboBoxItem(f, lang);
    } else if (Field.SELECT.equals(type)) {
        formItem = getSelectItem(f, lang);
    } else if (Field.RADIOGROUP.equals(type)) {
        formItem = getRadioGroupItem(f, lang);
    } else { // fallback
        formItem = getTextFormItem(f, lang);
    }
    return formItem;
}
 
开发者ID:proarc,项目名称:proarc,代码行数:23,代码来源:FormGenerator.java

示例7: formatValue

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
@Override
        public String formatValue(Object value, Record record, DynamicForm form, FormItem item) {
//            ClientUtils.severe(LOG, "format: class: %s, value: %s", ClientUtils.safeGetClass(value), value);
            if (value == null) {
                return null;
            }
            try {
                Date date = value instanceof Date
                        ? (Date) value : ISO_FORMAT.parse((String) value);
                return displayFormat.format(date);
            } catch (IllegalArgumentException ex) {
                String toString = String.valueOf(value);
                LOG.log(Level.WARNING, toString, ex);
                return toString;
            }
        }
 
开发者ID:proarc,项目名称:proarc,代码行数:17,代码来源:FormGenerator.java

示例8: parseValue

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
@Override
        public Object parseValue(String value, DynamicForm form, FormItem item) {
//            ClientUtils.severe(LOG, "parse: value: %s", value);
            Object result = null;
            if (value != null && !value.isEmpty()) {
                try {
                    Date date = displayFormat.parse(value);
                    result = ISO_FORMAT.format(date);
                } catch (IllegalArgumentException ex) {
                    String toString = String.valueOf(value);
                    LOG.log(Level.WARNING, toString, ex);
                    result = null;
                }
            }
            return result;
        }
 
开发者ID:proarc,项目名称:proarc,代码行数:17,代码来源:FormGenerator.java

示例9: createFullForm

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
private DynamicForm createFullForm() {
    DynamicForm f = new DynamicForm();
    f.setWidth100();
    f.setNumCols(2);
    f.setBrowserSpellCheck(false);
    f.setWrapItemTitles(false);
    f.setTitleOrientation(TitleOrientation.TOP);
    ArrayList<FormItem> items = new ArrayList<FormItem>();
    addElement(items, DcConstants.CONTRIBUTOR, null, true);
    addElement(items, DcConstants.COVERAGE, null, true);
    addElement(items, DcConstants.CREATOR, null, true);
    addElement(items, DcConstants.DATE, null, true);
    addElement(items, DcConstants.DESCRIPTION, null, true);
    addElement(items, DcConstants.FORMAT, null, true);
    addElement(items, DcConstants.IDENTIFIER, null, true);
    addElement(items, DcConstants.LANGUAGE, null, true);
    addElement(items, DcConstants.PUBLISHER, null, true);
    addElement(items, DcConstants.RELATION, null, true);
    addElement(items, DcConstants.RIGHTS, null, true);
    addElement(items, DcConstants.SOURCE, null, true);
    addElement(items, DcConstants.SUBJECT, null, true);
    addElement(items, DcConstants.TITLE, null, true);
    addElement(items, DcConstants.TYPE, null, true);
    f.setFields(items.toArray(new FormItem[items.size()]));
    return f;
}
 
开发者ID:proarc,项目名称:proarc,代码行数:27,代码来源:DcEditor.java

示例10: creatFormItems

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
private LinkedHashMap<String, FormItem> creatFormItems() {
    return new FormItemBuilder().addItem(DcConstants.TITLE, i18n.DCEditor_Titles_Title())
            .addItem(DcConstants.IDENTIFIER, i18n.DCEditor_Identifiers_Title())
            .addItem(DcConstants.CREATOR, i18n.DCEditor_Creators_Title())
            .addItem(DcConstants.CONTRIBUTOR, i18n.DCEditor_Contributors_Title())
            .addItem(DcConstants.COVERAGE, i18n.DCEditor_Coverage_Title())
            .addItem(DcConstants.DATE, i18n.DCEditor_Dates_Title())
            .addItem(DcConstants.FORMAT, i18n.DCEditor_Formats_Title())
            .addItem(DcConstants.LANGUAGE, i18n.DCEditor_Language_Title())
            .addItem(DcConstants.PUBLISHER, i18n.DCEditor_Publishers_Title())
            .addItem(DcConstants.RELATION, i18n.DCEditor_Relations_Title())
            .addItem(DcConstants.RIGHTS, i18n.DCEditor_Rights_Title())
            .addItem(DcConstants.SOURCE, i18n.DCEditor_Sources_Title())
            .addItem(DcConstants.SUBJECT, i18n.DCEditor_Subjects_Title())
            .addItem(DcConstants.TYPE, i18n.DCEditor_Types_Title())
            .addItem(DcConstants.DESCRIPTION, i18n.DCEditor_Descriptions_Title())
            .getItems();
}
 
开发者ID:proarc,项目名称:proarc,代码行数:19,代码来源:DcEditor.java

示例11: createFormItem

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
private FormItem createFormItem(Record editedRecord, ValueType valueType, DisplayType displayType) {
    FormItem fi = createFormItem(displayType, editedRecord);

    Boolean required = editedRecord.getAttributeAsBoolean(WorkflowModelConsts.PARAMETER_REQUIRED);
    ArrayList<Validator> validators = new ArrayList<Validator>();
    if (required != null && required) {
        validators.add(new RequiredIfValidator(requiredFunc));
    }
    if (valueType == ValueType.NUMBER && displayType != DisplayType.CHECKBOX) {
        validators.add(new IsFloatValidator());
    }
    if (!validators.isEmpty()) {
        fi.setValidators(validators.toArray(new Validator[validators.size()]));
    }
    return fi;
}
 
开发者ID:proarc,项目名称:proarc,代码行数:17,代码来源:WorkflowTaskFormView.java

示例12: resolveRecordValues

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
/**
     * Replace string values of record attributes with types declared by item children.
     * This is necessary as declarative forms do not use DataSource stuff.
     * @param record record to scan for attributes
     * @param item item with possible profile
     * @return resolved record
     */
    private static Record resolveRecordValues(Record record, FormItem item) {
        Field f = getProfile(item);
        if (f != null) {
            for (Field field : f.getFields()) {
                String fType = field.getType();
                if ("date".equals(fType) || "datetime".equals(fType)) {
                    // parses ISO dateTime to Date; otherwise DateItem cannot recognize the value!
                    Object value = record.getAttributeAsObject(field.getName());
                    if (!(value instanceof String)) {
                        continue;
                    }
                    String sd = (String) value;
//                    ClientUtils.severe(LOG, "name: %s, is date, %s", field.getName(), sd);
//                    Date d = DateTimeFormat.getFormat(PredefinedFormat.ISO_8601).parse("1994-11-05T13:15:30Z");
                    try {
                        Date d = DateTimeFormat.getFormat(PredefinedFormat.ISO_8601).parse(sd);
                        record.setAttribute(field.getName(), d);
                    } catch (IllegalArgumentException ex) {
                        LOG.log(Level.WARNING, sd, ex);
                    }
                }
            }
        }
        return record;
    }
 
开发者ID:proarc,项目名称:proarc,代码行数:33,代码来源:RepeatableFormItem.java

示例13: getForm

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
protected DynamicForm getForm(String headerString, FormItem... fields) {
		final DynamicForm form = new DynamicForm();
//		form.setBorder("1px solid");
		form.setWidth(280);

		HeaderItem header = new HeaderItem();
		header.setDefaultValue(headerString);
		ArrayList<FormItem> list = new ArrayList<FormItem>(fields.length+1);
		list.add(header);
		for (FormItem field: fields) {
			list.add(field);
		}
		
		form.setFields(list.toArray(new FormItem[]{}));
		return form;
	}
 
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:17,代码来源:ImportGame.java

示例14: createOpenQuestionWithImage

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
private void createOpenQuestionWithImage() {
		openQuestionWithImageCBItem = new CheckboxItem();
		openQuestionWithImageCBItem.setName("openQuestionWithImage");
		openQuestionWithImageCBItem.setTitle(constants.answerWithPicture());
		openQuestionWithImageCBItem.setShowIfCondition(new FormItemIfFunction() {  
            public boolean execute(FormItem item, Object value, DynamicForm form) {  
            	if (form.getValue("isOpenQuestion") == null) return false;
                return form.getValue("isOpenQuestion").equals(Boolean.TRUE);  
            }

        });  
//		openQuestionWithImageCBItem.addChangedHandler(new ChangedHandler() {
//
//			@Override
//			public void onChanged(ChangedEvent event) {
//				if ((Boolean)form.getValue("openQuestionWithImage")) form.setValue("openQuestionWithVideo", false);
//			}
//		});
		openQuestionWithImageCBItem.setStartRow(true);
	}
 
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:21,代码来源:DataCollectionEditor.java

示例15: createOpenQuestionWithVideo

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
private void createOpenQuestionWithVideo() {
		openQuestionWithVideoCBItem = new CheckboxItem();
		openQuestionWithVideoCBItem.setName("openQuestionWithVideo");
		openQuestionWithVideoCBItem.setTitle(constants.answerWithVideo());
		openQuestionWithVideoCBItem.setShowIfCondition(new FormItemIfFunction() {  
            public boolean execute(FormItem item, Object value, DynamicForm form) {  
            	if (form.getValue("isOpenQuestion") == null) return false;
                return form.getValue("isOpenQuestion").equals(Boolean.TRUE);  
            }

        });  
//		openQuestionWithVideoCBItem.addChangedHandler(new ChangedHandler() {
//
//			@Override
//			public void onChanged(ChangedEvent event) {
//				if ((Boolean)form.getValue("openQuestionWithVideo")) form.setValue("openQuestionWithImage", false);
//			}
//		});
		openQuestionWithVideoCBItem.setStartRow(true);

	}
 
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:22,代码来源:DataCollectionEditor.java


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