本文整理汇总了Java中com.extjs.gxt.ui.client.widget.form.Field类的典型用法代码示例。如果您正苦于以下问题:Java Field类的具体用法?Java Field怎么用?Java Field使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Field类属于com.extjs.gxt.ui.client.widget.form包,在下文中一共展示了Field类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getField
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
protected Field getField(AttributeModel aModel, final ValueModel v) {
TextField text = new TextField();
text.setFieldLabel(aModel.getDisplayName());
if (v != null) {
text.setValue(v.getValue());
} else {
text.setEmptyText("Edit...");
}
text.setAllowBlank(true);
text.setMinLength(4);
text.setAutoWidth(true);
text.addListener(Events.Change, new Listener<FieldEvent>() {
public void handleEvent(FieldEvent be) {
v.setUpdateValue((String)be.value);
Info.display("ChangeEvent", "OldValue {0} - NewValue{0} ", (String)be.oldValue, (String)be.value);
}
});
return(text);
}
开发者ID:luox12,项目名称:onecmdb,代码行数:24,代码来源:CIInstanceBrowser.java
示例2: buildEmailField
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
private Field<?> buildEmailField(String email, boolean enabled) {
Field<?> emailField = buildTextField(I18N.CONSTANTS.contactEmailAddress(), email, 50, enabled, true);
if (emailField instanceof TextField) {
// Very basic email regexp as an email field shouldn't be too restrictive
((TextField) emailField).setValidator(new Validator() {
@Override
public String validate(Field<?> field, String value) {
if (!RegExp.compile("^[email protected]+\\..+$").test(value)) {
return I18N.CONSTANTS.emailNotValidError();
}
return null;
}
});
((TextField) emailField).setRegex("^[email protected]+\\..+$");
}
return emailField;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:18,代码来源:DefaultContactFlexibleElementDTO.java
示例3: HistoryWrapper
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* Wrap the given field.
*
* @param field Field to wrap.
*/
public HistoryWrapper(Field<V> field) {
super(new FlowPanel());
this.field = field;
final Grid grid = new Grid(1, 2);
((FlowPanel)getWidget()).add(grid);
historyButton = Forms.button();
historyButton.setIcon(IconImageBundle.ICONS.history16());
grid.setWidget(0, 0, field);
grid.setWidget(0, 1, historyButton);
grid.getCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_TOP);
grid.getCellFormatter().setStyleName(0, 1, "flexibility-action-iconable");
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:22,代码来源:HistoryWrapper.java
示例4: updateComputation
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* Update the given computation element.
*
* @param computationElement
* Element to update.
* @param modifications
* Value change list.
*/
private void updateComputation(final ComputationElementDTO computationElement, final List<ValueEvent> modifications,
final boolean fireEvents, final Integer iterationId) {
final Computation computation = computations.get(computationElement);
final Loadable loadable;
final Field<String> computationView = components.get(computeKey(iterationId, computationElement));
if (computationView != null) {
loadable = new LoadingMask(computationView);
} else {
loadable = null;
}
computation.computeValueWithModificationsAndResolver(container, iterationId, modifications, valueResolver, new SuccessCallback<String>() {
@Override
public void onSuccess(String result) {
updateComputationElementWithValue(computationElement, result, modifications, fireEvents, iterationId);
}
}, loadable);
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:30,代码来源:ComputationTriggerManager.java
示例5: updateComputationElementWithValue
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* Update the given computation element with the given value.
*
* @param computationElement
* Computation element to update.
* @param value
* Result of the computation.
* @param modifications
* Value change list.
*/
private void updateComputationElementWithValue(final ComputationElementDTO computationElement, final String value,
final List<ValueEvent> modifications, final boolean fireEvents, Integer iterationId) {
final Field<String> field = components.get(computeKey(iterationId, computationElement));
if (field != null) {
field.setValue(value);
if (fireEvents) {
fireValueEvent(computationElement, iterationId, value);
}
} else {
// The affected computation is not displayed.
// Manually adding the value to the modifications.
modifications.add(new ValueEvent(computationElement, value));
// Manually firing the dependencies.
updateComputations(dependencies.get(computationElement), modifications, iterationId);
}
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:29,代码来源:ComputationTriggerManager.java
示例6: addField
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* Adds a field in the form.
*
* @param field
* The field.
* @param fieldLabelString
* The label of the field. Can be <code>null</code>.
*/
private void addField(Field<?> field, String fieldLabelString) {
// Builds the field label.
final Label fieldLabel = new Label(fieldLabelString);
fieldLabel.setWidth("165px");
fieldLabel.addStyleName("flexibility-element-label");
// Builds the field panel.
final ContentPanel fieldPanel = new ContentPanel();
fieldPanel.setBodyBorder(false);
fieldPanel.setHeaderVisible(false);
fieldPanel.setLayout(new HBoxLayout());
fieldPanel.add(fieldLabel, new HBoxLayoutData(new Margins(4, 20, 0, 0)));
final HBoxLayoutData flex = new HBoxLayoutData(new Margins(0, 20, 0, 0));
flex.setFlex(1);
fieldPanel.add(field, flex);
// Adds the field in the panel.
fieldsPanel.setHeight(FIELD_HEIGHT * fields.size());
fieldsPanel.add(fieldPanel, new VBoxLayoutData(new Margins(4, 0, 0, 0)));
fieldsPanel.layout();
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:32,代码来源:FormWindow.java
示例7: addChangeEventListener
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* Adds a change event listener to the given {@code widget} inner field(s).<br>
* If the widget is a {@link Container}, the method is executed recursively to retrieve the inner field(s).
*
* @param widget
* The widget.
*/
private void addChangeEventListener(final Widget widget) {
if (widget instanceof Field) {
final Field<?> field = (Field<?>) widget;
field.addListener(Events.Change, new Listener<FieldEvent>() {
@Override
public void handleEvent(final FieldEvent be) {
valueHasChanged = true;
}
});
} else if (widget instanceof Container) {
@SuppressWarnings("unchecked")
final Container<Component> container = (Container<Component>) widget;
for (final Component component : container.getItems()) {
addChangeEventListener(component);
}
}
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:33,代码来源:FormPanel.java
示例8: clearAll
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* Clears all values from all fields and remove all values in {@link Store}.
*/
public void clearAll() {
for (Field<?> f : getFields()) {
if (f instanceof TimeField) {
// TimeField store is only populated once, it should not be cleared.
f.setValue(null);
continue;
}
f.clear();
if (f instanceof ComboBox) {
((ComboBox<?>) f).getStore().removeAll();
}
}
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:19,代码来源:FormPanel.java
示例9: buildDirectMembershipField
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
private Field<?> buildDirectMembershipField(ContactDTO directMembership, boolean enabled) {
final LabelButtonField labelButtonField = buildLabelButtonField(enabled);
if (directMembership != null) {
labelButtonField.setValue(directMembership.getFullName());
} else {
labelButtonField.setValue(EMPTY_VALUE);
}
return labelButtonField;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:12,代码来源:DefaultContactFlexibleElementDTO.java
示例10: buildOwnerField
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* Creates the owner field.
* This field is always read-only.
*
* @param fullName Full name of the owner.
* @return The owner field.
*/
private Field<?> buildOwnerField(String fullName) {
final LabelField labelField = createLabelField();
// Sets the field label.
setLabel(I18N.CONSTANTS.projectOwner());
labelField.setFieldLabel(getLabel());
// Sets the value to the field.
labelField.setValue(fullName);
return labelField;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:20,代码来源:DefaultFlexibleElementDTO.java
示例11: upload
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void upload(FormPanel formPanel, final ProgressListener progressListener) {
final HashMap<String, String> properties = new HashMap<String, String>();
Blob blob = null;
for(final Field<?> field : formPanel.getFields()) {
if(field instanceof ButtonFileUploadField) {
final ButtonFileUploadField fileField = (ButtonFileUploadField) field;
if(blob != null) {
throw new IllegalStateException("Multiple files have been found in the given form.");
}
blob = Blob.getBlob(fileField);
} else if(field.getName() != null && field.getValue() instanceof String) {
// BUGFIX #781: Ignoring fields with invalid values to avoid serialization errors when synchronizing.
properties.put(field.getName(), (String) field.getValue());
}
}
if(blob == null) {
throw new IllegalStateException("No file have been found in the given form.");
}
prepareFileUpload(blob, properties, progressListener);
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:30,代码来源:Html5TransfertManager.java
示例12: isValid
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* Validates only the visible fields of the form.
*
* @return <code>true</code> if all visible fields are valids, <code>false</code> otherwise.
*/
private boolean isValid() {
boolean valid = true;
for (Field<?> field : view.getForm().getFields()) {
if (field.isVisible() && !field.isValid(true)) {
valid = false;
}
}
return valid;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:17,代码来源:EditIndicatorPresenter.java
示例13: buildColumnContainer
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* Builds a new layout container (block) for the given {@code columns} configuration.
*
* @param title
* The container title.
* @param columns
* The columns configuration (should not be {@code null} or empty).<br>
* The table size defines the total number of columns. Each column contains its fields.
* @return The layout container.
*/
private static LayoutContainer buildColumnContainer(final String title, final Field<?>[]... columns) {
final LayoutContainer columnsContainer = Panels.content(title, new ColumnLayout());
columnsContainer.setBorders(true);
columnsContainer.setWidth("100%");
columnsContainer.setStyleAttribute("marginTop", BLOCK_MARGIN_TOP + Unit.PX.getType());
final double columnWidth = 1.0d / columns.length; // Percentage.
for (final Field<?>[] column : columns) {
if (column == null) {
continue;
}
final LayoutContainer columnContainer = Forms.panel(FIELDS_LABEL_WIDTH);
for (final Field<?> field : column) {
columnContainer.add(field, Forms.data());
}
columnsContainer.add(columnContainer, new ColumnData(columnWidth));
}
return columnsContainer;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:37,代码来源:LogFrameModelsAdminView.java
示例14: KeyEscEvent
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
public KeyEscEvent(Field field) {
super(field);
}
开发者ID:luox12,项目名称:onecmdb,代码行数:4,代码来源:KeyEscEvent.java
示例15: KeyEnterEvent
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
public KeyEnterEvent(Field field) {
super(field);
}
开发者ID:luox12,项目名称:onecmdb,代码行数:4,代码来源:KeyEnterEvent.java
示例16: MultiEnterFieldEvent
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
public MultiEnterFieldEvent(Field field) {
super(field);
}
开发者ID:luox12,项目名称:onecmdb,代码行数:4,代码来源:MultiEnterFieldEvent.java
示例17: buildCountryField
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
protected Field<?> buildCountryField(CountryDTO country, boolean enabled) {
final Field<?> field;
if (enabled) {
final ComboBox<CountryDTO> comboBox = new ComboBox<CountryDTO>();
comboBox.setEmptyText(I18N.CONSTANTS.flexibleElementDefaultSelectCountry());
ensureCountryStore();
comboBox.setStore(countriesStore);
comboBox.setDisplayField(CountryDTO.NAME);
comboBox.setValueField(CountryDTO.ID);
comboBox.setTriggerAction(ComboBox.TriggerAction.ALL);
comboBox.setEditable(true);
comboBox.setAllowBlank(true);
// Listens to the selection changes.
comboBox.addSelectionChangedListener(new SelectionChangedListener<CountryDTO>() {
@Override
public void selectionChanged(SelectionChangedEvent<CountryDTO> se) {
String value = null;
final boolean isValueOn;
// Gets the selected choice.
final CountryDTO choice = se.getSelectedItem();
// Checks if the choice isn't the default empty choice.
isValueOn = choice != null && choice.getId() != null && choice.getId() != -1;
if (choice != null) {
value = String.valueOf(choice.getId());
}
if (value != null) {
// Fires value change event.
handlerManager.fireEvent(new ValueEvent(AbstractDefaultFlexibleElementDTO.this, value));
}
// Required element ?
if (getValidates()) {
handlerManager.fireEvent(new RequiredValueEvent(isValueOn));
}
}
});
if (country != null) {
comboBox.setValue(country);
}
field = comboBox;
} else /* not enabled */ {
final LabelField labelField = createLabelField();
if (country == null) {
labelField.setValue(EMPTY_VALUE);
} else {
labelField.setValue(country.getName());
}
field = labelField;
}
// Sets the field label.
setLabel(I18N.CONSTANTS.projectCountry());
field.setFieldLabel(getLabel());
return field;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:73,代码来源:AbstractDefaultFlexibleElementDTO.java
示例18: onExportProject
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* Method executed on export project action.
*
* @param project
* The project to export.
*/
private void onExportProject(final ProjectDTO project) {
view.buildExportDialog(new ExportActionHandler() {
@Override
public void onExportProject(final Field<Boolean> indicatorField, final Field<Boolean> logFrameField, final Field<Boolean> contactsField) {
final ServletUrlBuilder urlBuilder =
new ServletUrlBuilder(injector.getAuthenticationProvider(), injector.getPageManager(), Servlet.EXPORT, ServletMethod.EXPORT_PROJECT);
final ExportType type;
if (indicatorField.getValue()) {
if (logFrameField.getValue()) {
type = ExportType.PROJECT_SYNTHESIS_LOGFRAME_INDICATORS;
} else {
type = ExportType.PROJECT_SYNTHESIS_INDICATORS;
}
} else {
if (logFrameField.getValue()) {
type = ExportType.PROJECT_SYNTHESIS_LOGFRAME;
} else {
type = ExportType.PROJECT_SYNTHESIS;
}
}
urlBuilder.addParameter(RequestParameter.ID, project.getId());
urlBuilder.addParameter(RequestParameter.TYPE, type);
urlBuilder.addParameter(RequestParameter.WITH_CONTACTS, contactsField.getValue());
final FormElement form = FormElement.as(DOM.createForm());
form.setAction(urlBuilder.toString());
form.setTarget("_downloadFrame");
form.setMethod(Method.POST.name());
RootPanel.getBodyElement().appendChild(form);
form.submit();
form.removeFromParent();
}
});
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:49,代码来源:ProjectPresenter.java
示例19: getPhaseField
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public Field<Object> getPhaseField() {
return phaseField;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:8,代码来源:AttachFileView.java
示例20: getChangePwdLink
import com.extjs.gxt.ui.client.widget.form.Field; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public Field<Object> getChangePwdLink() {
return changePwdLink;
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:8,代码来源:UserEditView.java
注:本文中的com.extjs.gxt.ui.client.widget.form.Field类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论