本文整理汇总了Java中com.extjs.gxt.ui.client.event.ComponentEvent类的典型用法代码示例。如果您正苦于以下问题:Java ComponentEvent类的具体用法?Java ComponentEvent怎么用?Java ComponentEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ComponentEvent类属于com.extjs.gxt.ui.client.event包,在下文中一共展示了ComponentEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PageSizePagingToolBar
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的package包/类
public PageSizePagingToolBar(int pageSize) {
super(pageSize);
add(new SeparatorToolItem());
pageSizeField = new TextField<String>();
pageSizeField.setWidth(30);
pageSizeField.setValue("" + pageSize);
pageSizeField.addKeyListener(new KeyListener() {
@Override
public void componentKeyUp(ComponentEvent event) {
if (event.getKeyCode() == KeyboardListener.KEY_ENTER) {
refresh();
}
}
});
add(new AdapterToolItem(pageSizeField));
add(new AdapterToolItem(new LabelField("Page Size")));
//add(new AdapterToolItem(getSecurityGroupCombo()));
}
示例2: selectNewTemplate
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的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?");
}
示例3: getDeleteCI
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的package包/类
private SelectionListener getDeleteCI(final CIModel model) {
return(new SelectionListener<ComponentEvent>() {
@Override
public void componentSelected(ComponentEvent ce) {
ArrayList<CIModel> local = new ArrayList<CIModel>();
ArrayList<CIModel> base = new ArrayList<CIModel>();
base.add(model);
StoreAction.store(mdr, local, base, new CMDBAsyncCallback<StoreResult>() {
public void onSuccess(StoreResult result) {
if (result.isRejected()) {
MessageBox.alert("Failed", "Delete rejected, cause " + result.getRejectCause(), null);
return;
}
lP.load();
}
});
}
});
}
示例4: addTab
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的package包/类
@Override
public void addTab(String tabTitle, final Widget tabView) {
final TabItem tabItem = new TabItem(tabTitle);
tabItem.addListener(Events.Select, new Listener<ComponentEvent>() {
@Override
public void handleEvent(ComponentEvent be) {
fixTabViewHeight(tabView, tabItem);
}
});
tabItem.add(tabView);
Window.addResizeHandler(new ResizeHandler() {
@Override
public void onResize(ResizeEvent event) {
fixTabViewHeight(tabView, tabItem);
}
});
fixTabViewHeight(tabView, tabItem);
tabPanel.add(tabItem);
}
示例5: onBind
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的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();
}
});
}
示例6: mask
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的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);
}
});
}
}
示例7: initTools
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的package包/类
@Override
protected void initTools()
{
// Actually init the tools
super.initTools();
// Please implement delegates...
final Window thisAlias = this;
// The close button needs to remove the window from the desktop
closeBtn.addListener(Events.Select, new Listener<ComponentEvent>()
{
public void handleEvent(ComponentEvent ce)
{
desk.removeWindow(thisAlias);
}
});
}
示例8: DesktopMgr
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的package包/类
/**
* Default constructor
*/
public DesktopMgr()
{
// Listener for taskbar menu items
menuListener = new SelectionListener<MenuEvent>()
{
@Override
public void componentSelected(MenuEvent me)
{
itemSelected(me);
}
};
// Listener for shortcuts
shortcutListener = new SelectionListener<ComponentEvent>()
{
@Override
public void componentSelected(ComponentEvent ce)
{
itemSelected(ce);
}
};
}
示例9: generateDatePickerObj
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的package包/类
private AdapterField generateDatePickerObj()
{
final DatePicker dateObj = new DatePicker();
final AdapterField field = new AdapterField(dateObj);
field.setToolTip("点击修改内容");
dateObj.addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
String d = DateTimeFormat.getFormat("yyyy-MM-dd hh:mm:ss").format(dateObj.getValue());
// dateObj.setData(d);
field.setValue(d);
dateObj.hide();
}
});
return field;
}
示例10: onBlur
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的package包/类
@Override
protected void onBlur(final ComponentEvent ce) {
Rectangle rec = trigger.getBounds();
if (rec.contains(BaseEventPreview.getLastClientX(), BaseEventPreview.getLastClientY())) {
ce.stopEvent();
return;
}
if (menu != null && menu.isVisible()) {
return;
}
hasFocus = false;
doBlur(ce);
}
示例11: onTriggerClick
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的package包/类
@Override
protected void onTriggerClick(ComponentEvent ce) {
super.onTriggerClick(ce);
if (disabled || isReadOnly()) {
return;
}
expand();
}
示例12: doBlur
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的package包/类
private void doBlur(ComponentEvent ce) {
if (menu != null && menu.isVisible()) {
menu.hide();
}
super.onBlur(ce);
focusPreview.remove();
}
示例13: getMenuItem
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的package包/类
public static Item getMenuItem(final CMDBDesktopMenuItem desktopItem) {
if (desktopItem.isSeparator()) {
return(new SeparatorMenuItem());
}
MenuItem item = new MenuItem();
item.setText(desktopItem.getText());
item.setIconStyle(desktopItem.getIconStyle());
String toolTip = desktopItem.getTooltip();
if (toolTip != null && toolTip.length() > 0) {
item.setToolTip(toolTip);
}
if (desktopItem.getWindowItem() != null) {
item.addSelectionListener(new SelectionListener<ComponentEvent>() {
@Override
public void componentSelected(ComponentEvent ce) {
Dispatcher.get().dispatch(new AppEvent<CMDBDesktopMenuItem>(CMDBEvents.DESKTOP_MENU_SELECTED, desktopItem));
}
});
if (desktopItem.getWindowItem().isOpenAtStartup()) {
Dispatcher.get().dispatch(new AppEvent<CMDBDesktopMenuItem>(CMDBEvents.DESKTOP_MENU_SELECTED, desktopItem));
}
}
// Check if submenus.
if (desktopItem.getMenuItem()!= null && desktopItem.getMenuItem().size() > 0) {
Menu subMenu = new Menu();
List items = desktopItem.getMenuItem();
for (CMDBDesktopMenuItem dItem : desktopItem.getMenuItem()) {
subMenu.add(getMenuItem(dItem));
}
item.setSubMenu(subMenu);
}
return(item);
}
示例14: updateShortcuts
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的package包/类
public static void updateShortcuts(Desktop desktop, final CMDBDesktopMenuItem desktopItem) {
if (desktopItem.getWindowItem() != null) {
CMDBDesktopWindowItem windowItem = desktopItem.getWindowItem();
Object o = windowItem.get("shortcut");
if (o instanceof BaseModel) {
BaseModel shortcut = windowItem.get("shortcut");
Shortcut s = new Shortcut();
String sText = shortcut.get("text", "[Not specified!}");
String style = shortcut.get("style", "shortcuts-default");
String tooltip = shortcut.get("tooltip");
s.setText(sText);
s.setId(style);
if (tooltip != null && tooltip.length() > 0) {
s.setToolTip(tooltip);
}
s.addSelectionListener(new SelectionListener<ComponentEvent>() {
@Override
public void componentSelected(ComponentEvent ce) {
Dispatcher.get().dispatch(new AppEvent<CMDBDesktopMenuItem>(CMDBEvents.DESKTOP_MENU_SELECTED, desktopItem));
}
});
desktop.addShortcut(s);
}
}
// Check if submenus.
if (desktopItem.getMenuItem()!= null && desktopItem.getMenuItem().size() > 0) {
for (CMDBDesktopMenuItem childItem : desktopItem.getMenuItem()) {
updateShortcuts(desktop, childItem);
}
}
}
示例15: getDataSourcePreviewTab
import com.extjs.gxt.ui.client.event.ComponentEvent; //导入依赖的package包/类
private ContentPanel getDataSourcePreviewTab() {
final ContentPanel panel = new ContentPanel();
panel.setLayout(new FitLayout());
panel.getHeader().addTool(new ToolButton("x-tool-refresh", new SelectionListener<ComponentEvent>() {
@Override
public void componentSelected(ComponentEvent ce) {
reloadPreview(panel);
}
}));
preview = new PreviewTableWidget(transformConfig);
/*
preview.addListener(CMDBEvents.MDR_GRID_AVAILIABLE, new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
if (be.source instanceof GridModelConfig) {
setSourceColumns((GridModelConfig)be.source);
}
}
});
*/
panel.add(preview);
return(panel);
/*
LayoutContainer container = new LayoutContainer();
container.setLayout(new FitLayout());
container.add(new WidgetComponent(new TextArea()));
return(container);
*/
}