• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java FormItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: createOpenQuestionWithAudio

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
private void createOpenQuestionWithAudio() {
		openQuestionWithAudioCBItem = new CheckboxItem();
		openQuestionWithAudioCBItem.setName(OPENQUESTIONWITHAUTDIO);
		openQuestionWithAudioCBItem.setTitle(constants.answerWithAudio());
		openQuestionWithAudioCBItem.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);  
            }

        });
//		openQuestionWithAudioCBItem.addChangedHandler(new ChangedHandler() {
//
//			@Override
//			public void onChanged(ChangedEvent event) {
//				if (form.getValue(OPENQUESTIONWITHTEXT) == null) form.setValue(OPENQUESTIONWITHTEXT, false);
//
//				if ((Boolean)form.getValue(OPENQUESTIONWITHTEXT)) form.setValue(OPENQUESTIONWITHTEXT, false);
//			}
//		});
		openQuestionWithAudioCBItem.setStartRow(true);

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


示例17: initHasDependency

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
private void initHasDependency() {
	hasDependencyCheckboxItem = new CheckboxItem("hasDep", constants.hasDependency());
	hasDependencyCheckboxItem.addChangedHandler(new ChangedHandler() {
		
		@Override
		public void onChanged(ChangedEvent event) {
			hasDependency = (Boolean) event.getValue();
			redraw();
			
		}
	});
       hasDependencyCheckboxItem.setShowIfCondition(new FormItemIfFunction() {
           @Override
           public boolean execute(FormItem item, Object value, DynamicForm form) {
               return showHasDependencyCheckBox;
           }
       });
}
 
开发者ID:WELTEN,项目名称:dojo-ibl,代码行数:19,代码来源:ActionForm.java


示例18: buildUi

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
private void buildUi() {
	clear();
	dynamicForm = new DynamicForm();
	dynamicForm.setWidth100();
	dynamicForm.setColWidths(130, 200);
	attributeFormItems.clear();

	List<FormItem> formItemsList = new ArrayList<FormItem>();
	for (ConfiguredSearchAttribute attribute : searchConfig.getAttributes()) {
		SearchAttributeFormItem attributeFormItem = new SearchAttributeFormItem(getFormItem(attribute), attribute);
		attributeFormItems.add(attributeFormItem);
		formItemsList.add(attributeFormItem.getFormItem());
	}
	dynamicForm.setFields(formItemsList.toArray(new FormItem[formItemsList.size()]));
	setAlign(Alignment.CENTER);
	setWidth(430);
	setHeight(100);
	addChild(dynamicForm);
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:20,代码来源:ConfiguredSearchPanel.java


示例19: setDisabled

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
@Override
public void setDisabled(boolean disabled) {
	this.disabled = disabled;

	// Don't set disabled on the form, but on the individual items. This way it's easier to overwrite when creating
	// custom form items.
	for (AbstractAttributeInfo info : featureInfo.getAttributes()) {
		FormItem formItem = formWidget.getItem(info.getName());
		if (formItem != null) {
			if (editableItemNames.contains(info.getName())) {
				formItem.setDisabled(disabled);
			} else {
				formItem.setDisabled(true);
			}
		}
	}
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:18,代码来源:DefaultFeatureForm.java


示例20: addItemChangedHandler

import com.smartgwt.client.widgets.form.fields.FormItem; //导入依赖的package包/类
@Override
public HandlerRegistration addItemChangedHandler(ItemChangedHandler handler) {
	MultiHandlerRegistration registration = new MultiHandlerRegistration();
	// Due to custom made FormItems, we can't set the handler on the form anymore...
	final ItemChangedHandler itemChangedHandler = handler;
	registration.addRegistration(manager.addHandler(ItemChangedEvent.getType(), handler));
	for (final FormItem formItem : formWidget.getFields()) {
		ChangedHandler h = new ChangedHandler() {

			public void onChanged(ChangedEvent event) {
				itemChangedHandler.onItemChanged(new ItemChangedEvent(formItem.getJsObj()));
			}
		};
		registration.addRegistration(formItem.addChangedHandler(h));
	}
	return registration;
}
 
开发者ID:geomajas,项目名称:geomajas-project-client-gwt,代码行数:18,代码来源:DefaultFeatureForm.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DigesterLoader类代码示例发布时间:2022-05-22
下一篇:
Java IdWorker类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap