本文整理汇总了Java中com.extjs.gxt.ui.client.event.FieldEvent类的典型用法代码示例。如果您正苦于以下问题:Java FieldEvent类的具体用法?Java FieldEvent怎么用?Java FieldEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FieldEvent类属于com.extjs.gxt.ui.client.event包,在下文中一共展示了FieldEvent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getField
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的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: createProfilesComboBox
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
/**
* Creates the profiles combo box.
*/
private void createProfilesComboBox()
{
profilesComboBox = new ComboBox<UserGroupModel>();
profilesComboBox.setFieldLabel("Role");
profilesComboBox.setEmptyText("(No role available)");
profilesComboBox.setDisplayField(BeanKeyValue.NAME.getValue());
profilesComboBox.setEditable(false);
profilesComboBox.setStore(getAvailableProfiles());
profilesComboBox.setTypeAhead(true);
profilesComboBox.setTriggerAction(TriggerAction.ALL);
profilesComboBox.setAllowBlank(false);
profilesComboBox.setLazyRender(false);
// profilesComboBox.setWidth(150);
profilesComboBox.addListener(Events.TriggerClick, new Listener<FieldEvent>()
{
public void handleEvent(FieldEvent be)
{
profilesComboBox.getStore().getLoader().load();
}
});
fieldSet.add(profilesComboBox);
}
开发者ID:geoserver,项目名称:geofence,代码行数:29,代码来源:AddGsUserWidget.java
示例3: addUndeletableCustomChoice
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void addUndeletableCustomChoice(final String value, boolean checked, final Listener<FieldEvent> disableHandler) {
final ClickableLabel customChoiceLabel = new ClickableLabel(value);
final Grid grid = (Grid) customChoiceLabel.getWidget();
final CheckBox checkBox = new CheckBox();
checkBox.setValue(checked);
grid.setWidget(0, 0, checkBox);
if(disableHandler != null) {
checkBox.addListener(Events.Change, disableHandler);
}
customChoicesPanel.add(customChoiceLabel);
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:20,代码来源:EditFlexibleElementAdminView.java
示例4: onDefaultCheck
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
private void onDefaultCheck(FieldEvent event) {
final boolean newValue = defaultViewCheckBox.getValue();
N10N.confirmation(I18N.CONSTANTS.defaultView(), I18N.CONSTANTS.confirmDefaultViewChange(), new ConfirmCallback() {
@Override
public void onAction() {
persistDefaultView(newValue);
}
}, new ConfirmCallback() {
@Override
public void onAction() {
defaultViewCheckBox.setValue(!newValue);
}
});
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:19,代码来源:ProjectPivotContainer.java
示例5: addChangeEventListener
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的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
示例6: getImportUsersComboBox
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
private ComboBox<BeanModel> getImportUsersComboBox(){
exportSourceComboBox = new ComboBox<BeanModel>();
exportSourceComboBox.setDisplayField("description");
exportSourceComboBox.setWidth(150);
exportSourceComboBox.setName("authmethod");
exportSourceComboBox.setFieldLabel("Auth method");
exportSourceComboBox.setAllowBlank(false);
exportSourceComboBox.setEditable(false);
exportSourceComboBox.setStore(createImportSourceStore());
exportSourceComboBox.setTypeAhead(true);
exportSourceComboBox.setTriggerAction(TriggerAction.ALL);
exportSourceComboBox.addListener(Events.Select, new Listener<FieldEvent>(){
@Override public void handleEvent(FieldEvent fe) {
Integer sourceId = Integer.parseInt(exportSourceComboBox.getValue().get("id").toString());
loadGrid(sourceId);
}
});
exportSourceComboBox.select(exportSourceComboBox.getStore().getAt(0));
return exportSourceComboBox;
}
开发者ID:treblereel,项目名称:Opensheet,代码行数:24,代码来源:ImportUsersFromExternalStoreGrid.java
示例7: onKeyPress
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
@Override
protected void onKeyPress(FieldEvent fe) {
super.onKeyPress(fe);
int code = fe.event.getKeyCode();
if (code == 8 || code == 9) {
if (menu != null && menu.isAttached()) {
menu.hide();
}
}
}
开发者ID:luox12,项目名称:onecmdb,代码行数:11,代码来源:AdaptableTriggerField.java
示例8: onRender
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
@Override
protected void onRender(Element target, int index) {
super.onRender(target, index);
getInputEl().disable();
focusPreview = new BaseEventPreview();
new KeyNav<FieldEvent>(this) {
public void onDown(FieldEvent fe) {
MultiValueComboBox.this.onDown(fe);
}
};
}
开发者ID:luox12,项目名称:onecmdb,代码行数:13,代码来源:MultiValueComboBox.java
示例9: setCountry
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
@Override
public void setCountry(CountryDTO country, Listener<FieldEvent> selectionListener) {
topLevelComboBox = null;
for(final ComboBox<?> box : adminLevelBoxes) {
box.removeAllListeners();
form.remove(box);
}
adminLevelBoxes.clear();
if(country != null) {
ComboBox<AdminEntityDTO> parentComboBox = null;
int row = 2;
for(final AdminLevelDTO level : country.getAdminLevels()) {
final ComboBox<AdminEntityDTO> comboBox = Forms.combobox(level.getName(), false, AdminEntityDTO.ID, AdminEntityDTO.NAME);
comboBox.setName(AdminEntityDTO.getPropertyName(level.getId()));
comboBox.setEnabled(false);
comboBox.setTriggerAction(ComboBox.TriggerAction.ALL);
comboBox.setData("level", level);
if(parentComboBox != null) {
comboBox.setData("parent", parentComboBox);
parentComboBox.setData("child", comboBox);
} else {
topLevelComboBox = comboBox;
}
comboBox.addListener(Events.Select, selectionListener);
comboBox.addListener(Events.KeyUp, selectionListener);
parentComboBox = comboBox;
adminLevelBoxes.add(comboBox);
form.insert(comboBox, row++, Forms.data());
}
form.layout();
}
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:41,代码来源:EditSiteView.java
示例10: onAddUndeletableCustomChoice
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
/**
* Callback executed on custom choice add action.<br>
* Does nothing if one of the arguments is {@code null} or if the {@code customChoice} is already present.
*
* @param customChoice
* The custom choice value.
*/
private void onAddUndeletableCustomChoice(final String customChoice, boolean checked) {
view.getCustomChoiceField().clear();
if (ClientUtils.isBlank(customChoice) || customChoices.contains(customChoice)) {
return;
}
if(!checked) {
disabledCustomChoices.add(customChoice);
}
view.addUndeletableCustomChoice(customChoice, checked, new Listener<FieldEvent>() {
@Override
public void handleEvent(FieldEvent be) {
final Boolean value = (Boolean) be.getValue();
if(value != null && value) {
disabledCustomChoices.remove(customChoice);
} else {
disabledCustomChoices.add(customChoice);
}
}
});
customChoices.add(customChoice);
view.getCategoryTypeField().setEnabled(false);
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:36,代码来源:EditFlexibleElementAdminPresenter.java
示例11: onDown
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
protected void onDown(FieldEvent fe) {
fe.cancelBubble();
if (menu == null || !menu.isAttached()) {
expand();
}
}
开发者ID:luox12,项目名称:onecmdb,代码行数:7,代码来源:AdaptableTriggerField.java
示例12: onRender
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
@Override
protected void onRender(Element target, int index) {
if (el() != null) {
super.onRender(target, index);
return;
}
input = new El(DOM.createInputText());
input.disable();
wrap = new El(DOM.createDiv());
wrap.dom.setClassName("x-form-field-wrap");
input.addStyleName(fieldStyle);
trigger = new El(DOM.createImg());
trigger.dom.setClassName("x-form-trigger " + triggerStyle);
trigger.dom.setPropertyString("src", GXT.BLANK_IMAGE_URL);
wrap.dom.appendChild(input.dom);
wrap.dom.appendChild(trigger.dom);
setElement(wrap.dom, target, index);
if (isHideTrigger()) {
trigger.setVisible(false);
}
super.onRender(target, index);
triggerListener = new EventListener() {
public void onBrowserEvent(Event event) {
if (!disabled) {
FieldEvent ce = new FieldEvent(AdaptableTriggerField.this);
ce.event = event;
ce.type = DOM.eventGetType(event);
ce.stopEvent();
onTriggerEvent(ce);
}
}
};
DOM.sinkEvents(wrap.dom, Event.FOCUSEVENTS);
DOM.sinkEvents(trigger.dom, Event.ONCLICK | Event.MOUSEEVENTS);
if (width == null) {
setWidth(150);
}
focusPreview = new BaseEventPreview();
new KeyNav<FieldEvent>(this) {
public void onDown(FieldEvent fe) {
AdaptableTriggerField.this.onDown(fe);
}
};
}
开发者ID:luox12,项目名称:onecmdb,代码行数:54,代码来源:AdaptableTriggerField.java
示例13: createLayersRenderer
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
/**
* Creates the workspaces layers combo box.
*
* @return the grid cell renderer
*/
private GridCellRenderer<RuleModel> createLayersRenderer()
{
GridCellRenderer<RuleModel> comboRendered = new GridCellRenderer<RuleModel>()
{
// private boolean init;
public Object render(final RuleModel model, String property, ColumnData config,
int rowIndex, int colIndex, ListStore<RuleModel> store, Grid<RuleModel> grid)
{
// if (!init)
// {
// init = true;
// grid.addListener(Events.ColumnResize, new ResizeListener(10));
// }
// TODO: generalize this!
ComboBox<Layer> combo = new ComboBox<Layer>();
combo.setId("editRuleLayer");
combo.setName("editRuleLayer");
combo.setDisplayField(BeanKeyValue.LAYER.getValue());
combo.setStore(layers);
combo.setEditable(true);
combo.setTypeAhead(true);
combo.setTriggerAction(TriggerAction.ALL);
// workspaceLayersComboBox.setWidth(120);
combo.setWidth(COLUMN_LAYER_WIDTH - COLUMN_HEADER_OFFSET);
// combo.setAutoWidth(true);
if (model.getLayer() != null)
{
combo.setValue(new Layer(model.getLayer()));
combo.setSelection(Arrays.asList(new Layer(model.getLayer())));
}
combo.setEmptyText("(No layer available)");
combo.addListener(Events.Select, new Listener<FieldEvent>()
{
public void handleEvent(FieldEvent be)
{
final Layer layer = (Layer) be.getField().getValue();
model.setLayer(layer.getLayer());
Dispatcher.forwardEvent(GeofenceEvents.RULE_UPDATE_EDIT_GRID_COMBO, model);
}
});
return combo;
}
};
return comboRendered;
}
开发者ID:geoserver,项目名称:geofence,代码行数:62,代码来源:EditRuleWidget.java
示例14: createToolBar
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
private void createToolBar() {
// Save button.
saveButton = Forms.saveSplitButton();
saveButtonSeparator = new SeparatorToolItem();
// Site filter combo box.
siteFilter = new SiteFilterCombo(dispatcher);
// Indicator filter combo box.
indicatorFilter = new IndicatorFilterCombo(dispatcher);
// Date filter combo box.
dateFilter = new DateFilterCombo();
// Set as default view checkbox.
defaultViewCheckBox = new CheckBox();
defaultViewCheckBox.addListener(Events.OnClick, new Listener<FieldEvent>() {
@Override
public void handleEvent(FieldEvent event) {
onDefaultCheck(event);
}
});
final Label defaultViewLabel = new Label(I18N.CONSTANTS.defaultView());
defaultViewLabel.setLabelFor(defaultViewCheckBox.getId());
// Creating the tool bar.
toolBar = new ToolBar();
toolBar.addStyleName(ProjectPivotResources.INSTANCE.style().toolbar());
toolBar.add(saveButton);
toolBar.add(saveButtonSeparator);
toolBar.add(new Label(I18N.CONSTANTS.site()));
toolBar.add(siteFilter);
toolBar.add(new Label(I18N.CONSTANTS.indicator()));
toolBar.add(indicatorFilter);
toolBar.add(new Label(I18N.CONSTANTS.indicatorFilterToolBarLabel()));
toolBar.add(dateFilter);
toolBar.add(new FillToolItem());
toolBar.add(historySelector.getPrevButton());
toolBar.add(historySelector.getNextButton());
toolBar.add(defaultViewLabel);
toolBar.add(defaultViewCheckBox);
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:45,代码来源:ProjectPivotContainer.java
示例15: onBind
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
@Override
public void onBind() {
// On Select Combo Champs (case budget)
view.getFlexibleElementsCombo().addListener(Events.Select, new Listener<FieldEvent>() {
@Override
public void handleEvent(FieldEvent event) {
final boolean selectionIsBudget = view.getFlexibleElementsCombo().getValue() instanceof BudgetElementDTO;
view.getBudgetSubFlexTable().setVisible(selectionIsBudget);
view.getVariablesCombo().setVisible(!selectionIsBudget);
view.getVariablesCombo().setAllowBlank(selectionIsBudget);
}
});
// Save Matching rule
view.getSubmitButton().addListener(Events.OnClick, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
if(!view.isValid()) {
return;
}
final boolean forKey = view.getIsKeyCheckBox().getValue();
if(forKey && view.getFlexibleElementsCombo().getValue() == null) {
N10N.error(I18N.CONSTANTS.adminImportKeyIdentification(),
I18N.CONSTANTS.adminImportKeyIdentificationMessage());
} else {
createVariableFlexibleElement(forKey);
}
}
});
}
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:43,代码来源:AddMatchingRuleImportationShemeModelsAdminPresenter.java
示例16: createContents
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
/**
* Builds the UI
*/
private void createContents()
{
setSize("254", "100");
setMinimizable(true);
setHeading("Alliance Search");
setLayout(new RowLayout(Orientation.VERTICAL));
this.frmSearch = new FormPanel();
this.frmSearch.setBodyBorder(false);
this.frmSearch.setLabelWidth(35);
this.frmSearch.setHeaderVisible(false);
this.frmSearch.setHeading("New FormPanel");
this.btnSearch = new Button("Search");
this.btnSearch.addSelectionListener(new SelectionListener<ButtonEvent>()
{
public void componentSelected(ButtonEvent ce)
{
executeSearch();
}
});
this.btnSearch.setTabIndex(2);
this.frmSearch.addButton(btnSearch);
this.btnSearch.setWidth("68px");
this.cboAllianceName = new ComboBox<BeanModel>();
this.cboAllianceName.setTabIndex(1);
this.cboAllianceName.setStore(new ListStore<BeanModel>());
cboAllianceName.setMessageTarget("tooltip");
cboAllianceName.setAllowBlank(false);
cboAllianceName.setTriggerAction(TriggerAction.ALL);
cboAllianceName.setSelectOnFocus(true);
cboAllianceName.setForceSelection(true);
cboAllianceName.setTypeAheadDelay(100);
cboAllianceName.setTypeAhead(true);
cboAllianceName.addListener(Events.KeyPress, new Listener<FieldEvent>()
{
@Override
public void handleEvent(FieldEvent e)
{
if (e.getKeyCode() == KeyCodes.KEY_ENTER)
{
executeSearch();
}
}
});
this.frmSearch.add(this.cboAllianceName, new FormData("100%"));
this.cboAllianceName.setFieldLabel("Name");
add(this.frmSearch, new RowData(Style.DEFAULT, 1.0, new Margins()));
}
开发者ID:recon-null,项目名称:eve_finger,代码行数:57,代码来源:WinSearchAlliance.java
示例17: createContents
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
/**
* Builds the UI
*/
private void createContents()
{
setSize("254", "100");
setMinimizable(true);
setHeading("Character Search");
setLayout(new RowLayout(Orientation.VERTICAL));
this.frmSearch = new FormPanel();
this.frmSearch.setBodyBorder(false);
this.frmSearch.setLabelWidth(35);
this.frmSearch.setHeaderVisible(false);
this.frmSearch.setHeading("New FormPanel");
this.txtCharName = new TextField<String>();
this.txtCharName.setSelectOnFocus(true);
this.txtCharName.addListener(Events.KeyPress, new Listener<FieldEvent>() {
public void handleEvent(FieldEvent e)
{
if (e.getKeyCode() == KeyCodes.KEY_ENTER)
{
executeSearch();
}
}
});
this.txtCharName.setTabIndex(1);
this.frmSearch.add(this.txtCharName, new FormData("100%"));
this.txtCharName.setFieldLabel("Name");
this.btnSearch = new Button("Search");
this.btnSearch.addSelectionListener(new SelectionListener<ButtonEvent>()
{
public void componentSelected(ButtonEvent ce)
{
executeSearch();
}
});
this.btnSearch.setTabIndex(2);
this.frmSearch.addButton(btnSearch);
this.btnSearch.setWidth("68px");
add(this.frmSearch, new RowData(Style.DEFAULT, 1.0, new Margins()));
}
开发者ID:recon-null,项目名称:eve_finger,代码行数:47,代码来源:WinSearchChar.java
示例18: createContents
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
/**
* Builds the GUI.
*/
private void createContents()
{
setModal(true);
setBlinkModal(false);
this.setClosable(false);
this.setSize("300px", "125px");
this.setHeading("Login");
this.setLayout(new RowLayout(Orientation.VERTICAL));
frmLogin = new FormPanel();
frmLogin.setBodyBorder(false);
frmLogin.setHeaderVisible(false);
frmLogin.setHeading("");
this.txtUsername = new TextField<String>();
this.txtUsername.setId("username");
this.txtUsername.setSelectOnFocus(true);
this.txtUsername.setTabIndex(1);
this.txtUsername.setMaxLength(50);
frmLogin.add(txtUsername, new FormData("100%"));
this.txtUsername.setFieldLabel("Username");
this.txtPassword = new TextField<String>();
this.txtPassword.setId("passwd");
this.txtPassword.addListener(Events.KeyPress, new Listener<FieldEvent>() {
public void handleEvent(FieldEvent e)
{
if (e.getKeyCode() == KeyCodes.KEY_ENTER)
{
executeLogin();
}
}
});
this.txtPassword.setMaxLength(50);
this.txtPassword.setTabIndex(2);
this.txtPassword.setSelectOnFocus(true);
this.txtPassword.setPassword(true);
frmLogin.add(txtPassword, new FormData("100%"));
this.txtPassword.setFieldLabel("Password");
btnLogin = new Button("Login");
frmLogin.addButton(btnLogin);
btnLogin.addSelectionListener(new SelectionListener<ButtonEvent>()
{
public void componentSelected(ButtonEvent ce)
{
executeLogin();
}
});
btnLogin.setTabIndex(3);
this.add(frmLogin, new RowData(1.0, 1.0, new Margins()));
}
开发者ID:recon-null,项目名称:eve_finger,代码行数:57,代码来源:WinLogin.java
示例19: addUndeletableCustomChoice
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
/**
* Adds the given {@code customChoice} as an existing custom that can't be deleted.
*
* @param customChoice
* The custom choice label.
* @param checked
* Initial value of the checkbox.
* @param disableHandler
* The disable handler triggered if the associated checkbox is selected.
*/
void addUndeletableCustomChoice(String customChoice, boolean checked, Listener<FieldEvent> disableHandler);
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:12,代码来源:EditFlexibleElementAdminPresenter.java
示例20: setCountry
import com.extjs.gxt.ui.client.event.FieldEvent; //导入依赖的package包/类
void setCountry(CountryDTO country, Listener<FieldEvent> selectionListener);
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:2,代码来源:EditSitePresenter.java
注:本文中的com.extjs.gxt.ui.client.event.FieldEvent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论