本文整理汇总了Java中com.extjs.gxt.ui.client.event.Listener类的典型用法代码示例。如果您正苦于以下问题:Java Listener类的具体用法?Java Listener怎么用?Java Listener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Listener类属于com.extjs.gxt.ui.client.event包,在下文中一共展示了Listener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHighlightTermsButton
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
private ToggleButton getHighlightTermsButton() {
if (highlightTermsButton == null) {
highlightTermsButton = new ToggleButton();
highlightTermsButton.setIcon(IconHelper.createPath("resources/themes/slate/images/slate/special/d2_hilight_tool.png"));
highlightTermsButton.addListener(Events.Select, new Listener<ButtonEvent>() {
public void handleEvent(ButtonEvent be) {
OpenAjaxMessage message = OpenAjaxMessageFactory.create();
if (highlightTermsButton.isPressed())
message.setValue("1");
else
message.setValue("0");
openAjaxHub.send("D2_ACTION_SEARCH_HIGHLIGHT_TERMS", message);
}
});
highlightTermsButton.toggle();
}
return highlightTermsButton;
}
示例2: getStartSelectionListener
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
private SelectionListener getStartSelectionListener() {
return(new SelectionListener<ToolBarEvent>() {
@Override
public void componentSelected(ToolBarEvent ce) {
if (selectedItems == null || selectedItems.size() == 0) {
return;
}
MDRStartWindow start = new MDRStartWindow(selectedMDR, selectedItems);
start.setCloseAction(CloseAction.CLOSE);
start.addListener(Events.Close, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
reloadHistory();
}
});
start.show();
}
});
}
示例3: getOperationListener
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
private Listener<MenuEvent> getOperationListener() {
if (opSelection == null) {
opSelection = new Listener<MenuEvent>() {
public void handleEvent(MenuEvent be) {
CheckMenuItem item = (CheckMenuItem) be.item;
if (item.isChecked()) {
getLoadConfig().set("searchOperation", item.getData("operation"));
getLoadConfig().set("searchOperationNot", item.getData("notOperation"));
} else {
}
}
};
}
return(opSelection);
}
示例4: getSearchOnListener
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
private Listener<MenuEvent> getSearchOnListener() {
if (searchOnListener == null) {
searchOnListener = new Listener<MenuEvent>() {
public void handleEvent(MenuEvent be) {
CheckMenuItem item = (CheckMenuItem) be.item;
if (item.isChecked()) {
getLoadConfig().set("searchAttributeConfig", item.getData("cfg"));
} else {
}
}
};
}
return(searchOnListener);
}
示例5: selectNewTemplate
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
protected void selectNewTemplate(final EditorGrid<CIModelCollection> editGrid, Element target) {
List<String> types = new ArrayList<String>();
types.add(gridConfig.getNewModel().getAlias());
CITemplateBrowser template = new CITemplateBrowser(gridConfig.getMDR(), types);
//template.setCheckable(true, null);
final SelectContentPanel<CIModel> sel = new SelectContentPanel<CIModel>("Select a template", template);
final AdaptableMenu menu = new AdaptableMenu(sel, "");
menu.addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent ce) {
menu.hide();
CIModel model = sel.getValue();
addNewItem(editGrid, model);
}
});
menu.addListener(Events.Hide, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
menu.hide();
}
});
menu.show(target, "tl-bl?");
}
示例6: bind
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
@Override
public void bind(PagingLoader loader) {
super.bind(loader);
if (loader instanceof BasePagingLoader) {
config = getLoadConfig();
((BasePagingLoadConfig)config).set("query", gridConfig.getQuery());
config.setOffset(0);
config.setLimit(pageSize);
((BasePagingLoader)loader).setReuseLoadConfig(true);
((BasePagingLoader)loader).useLoadConfig(config);
}
loader.addListener(Loader.BeforeLoad, new Listener<LoadEvent>() {
public void handleEvent(LoadEvent be) {
if (be.config instanceof BasePagingLoadConfig) {
beforeLoad((BasePagingLoadConfig)be.config);
}
}
});
}
示例7: deleteSelected
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
protected void deleteSelected() {
final List<BaseModel> items = grid.getSelectionModel().getSelectedItems();
final MessageBox confirm = MessageBox.confirm("Delete", "Delete " + items.size() + " default values", new Listener<WindowEvent>() {
public void handleEvent(WindowEvent be) {
Button btn = be.buttonClicked;
if (btn.getItemId().equals(Dialog.YES)) {
// Remove items...
for (BaseModel item : items) {
store.remove(item);
removeModel(item);
}
}
}
});
}
示例8: update
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
public void update() {
// Remove
south.removeAll();
PreviewTableWidget preview = new PreviewTableWidget(cfg);
preview.addListener(CMDBEvents.MDR_GRID_AVAILIABLE, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
if (be.source instanceof GridModelConfig) {
selectorTable.setSourceGridConfig((GridModelConfig)be.source);
}
}
});
south.add(preview);
layout();
}
示例9: getField
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的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);
}
示例10: mask
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
protected final void mask() {
if (component == null) {
return;
}
if (component.isRendered()) {
// If the component is already rendered, apply mask immediately.
handleRenderEvent(null, null);
} else {
// If the component is not rendered yet, wait until after it is all layed out before applying the mask.
final EventType eventType = component instanceof Container ? Events.AfterLayout : Events.Render;
component.addListener(eventType, new Listener<ComponentEvent>() {
@Override
public void handleEvent(final ComponentEvent be) {
handleRenderEvent(eventType, this);
}
});
}
}
示例11: onBind
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void onBind() {
// Enter key handler.
view.getEmailField().addListener(Events.KeyDown, new KeyListener() {
@Override
public void componentKeyDown(final ComponentEvent event) {
if (event.getKeyCode() == KeyCodes.KEY_ENTER) {
onValidateAction();
}
}
});
// Validate button action handler.
view.getValidateButton().addListener(Events.Select, new Listener<BaseEvent>() {
@Override
public void handleEvent(final BaseEvent be) {
onValidateAction();
}
});
}
示例12: onBind
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void onBind() {
// Enter key handler.
view.getPasswordField().addKeyDownHandler(keyDownHandler);
view.getPasswordConfirmationField().addKeyDownHandler(keyDownHandler);
// Validate button action handler.
view.getValidateButton().addListener(Events.Select, new Listener<BaseEvent>() {
@Override
public void handleEvent(final BaseEvent be) {
onValidateAction();
}
});
}
示例13: addChangeEventListener
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的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);
}
}
}
示例14: MenuAction
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
/**
* Builds this action.
*/
public MenuAction() {
item = new MenuItem(getText(), getIcon());
// Action.
item.addListener(Events.Select, new Listener<BaseEvent>() {
@Override
public void handleEvent(BaseEvent be) {
perform();
}
});
// Defines the default policy.
inactivationPolicy = InactivationPolicy.DISABLE_POLICY;
}
示例15: createSelectionModel
import com.extjs.gxt.ui.client.event.Listener; //导入依赖的package包/类
private CheckBoxSelectionModel<TreeGridFileModel> createSelectionModel(final TreeStore<TreeGridFileModel> store) {
final CheckBoxSelectionModel<TreeGridFileModel> selectionModel = new CheckBoxSelectionModel<TreeGridFileModel>();
selectionModel.addListener(Events.BeforeSelect, new Listener<SelectionEvent<TreeGridFileModel>>() {
@Override
public void handleEvent(SelectionEvent<TreeGridFileModel> be) {
final TreeGridFileModel model = be.getModel();
if(model.getChildren() != null) {
selectionModel.select(store.getChildren(model), true);
}
}
});
return selectionModel;
}