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


Java Field类代码示例

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


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


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