• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Dispatcher类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Dispatcher类属于com.extjs.gxt.ui.client.mvc包,在下文中一共展示了Dispatcher类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: startActivityTimeout

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
/**
 * Start a timer that will logout user when timeout time has elapsed 
 * and no browser activity has been reached.
 * 
 * @param timeout
 */
protected void startActivityTimeout(final int timeout) {
	if (CMDBSession.get().getConfig().getDesktopLockTimeout() < 0) {
		return;
	}
	// Check every min
	final int checkIntervall = 60*1000; 
	if (activityTimer != null) {
		return;
	}
	activityTimer = new Timer() {

		@Override
		public void run() {
			long now = System.currentTimeMillis();
			if ((lastActivityTime + timeout) < now) {
				Dispatcher.get().dispatch(CMDBEvents.DESKTOP_LOCK_TIMEOUT);
			} else {
				this.schedule(checkIntervall);
			}
			
		}
	};
	activityTimer.schedule(checkIntervall);
	
}
 
开发者ID:afbytes,项目名称:OneCMDBwithMaven,代码行数:32,代码来源:DesktopContoller.java


示例2: createNorth

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
/**
 * Creates the north.
 */
private void createNorth()
{
    north = new ContentPanel();
    north.setHeaderVisible(false);
    north.addListener(Events.Resize, new Listener<BaseEvent>()
        {

            public void handleEvent(BaseEvent be)
            {
                Dispatcher.forwardEvent(GeoGWTEvents.UPDATE_MAP_SIZE);
                // Dispatcher.forwardEvent(GeofenceEvents.UPDATE_SOUTH_SIZE);
            }
        });

    BorderLayoutData data = new BorderLayoutData(LayoutRegion.NORTH,
            Constants.NORTH_PANEL_DIMENSION);
    data.setMargins(new Margins(0, 5, 0, 5));
    data.setSplit(true);

    viewport.add(north, data);
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:25,代码来源:AppView.java


示例3: addBaseLayer

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
/**
 *
 */
private void addBaseLayer()
{

	GeofenceGlobalConfiguration geoFenceConfiguration = (GeofenceGlobalConfiguration) GeofenceUtils.getInstance().getGlobalConfiguration();
	
    /* base layer */
    WMSParams wmsParams = new WMSParams();
    wmsParams.setLayers(geoFenceConfiguration.getBaseLayerName());
    wmsParams.setFormat(geoFenceConfiguration.getBaseLayerFormat());
    wmsParams.setStyles(geoFenceConfiguration.getBaseLayerStyle());

    WMSOptions wmsLayerParams = new WMSOptions();
    wmsLayerParams.setTransitionEffect(TransitionEffect.RESIZE);

    WMS layer = new WMS(geoFenceConfiguration.getBaseLayerTitle(),
    		geoFenceConfiguration.getBaseLayerURL(), wmsParams, wmsLayerParams);
    Dispatcher.forwardEvent(GeoGWTEvents.ADD_LAYER, layer);
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:22,代码来源:AppView.java


示例4: performAction

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
@Override
public void performAction(Button button)
{
    MessageBox.confirm(I18nProvider.getMessages().logoutDialogTitle(), I18nProvider.getMessages().logoutDialogMessage(), new Listener<MessageBoxEvent>()
        {

            public void handleEvent(MessageBoxEvent be)
            {
                Button btn = be.getButtonClicked();
                if (btn.getText().equalsIgnoreCase("YES"))
                {
                    Dispatcher.forwardEvent(GeofenceEvents.LOGOUT);
                }
            }
        });
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:17,代码来源:LogoutAction.java


示例5: onEditRowRuleDetails

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
/**
 * On edit rule details.
 * 
 * @param event
 *            the event
 */
private void onEditRowRuleDetails(AppEvent event) {
	if ((event.getData() != null) && (event.getData() instanceof RuleModel)) {
		this.ruleRowEditor.reset();
		this.ruleRowEditor.status = "INSERT";
		showPanel(event);
	} else if ((event.getData() != null)
			&& (event.getData() instanceof GridStatus)) {
		this.ruleRowEditor.reset();
		this.ruleRowEditor.status = "INSERT";
		this.ruleRowEditor.parentGrid = ((GridStatus) event.getData())
				.getGrid();
		this.ruleRowEditor.model = ((GridStatus) event.getData())
				.getModel();
		showPanelData(event);

	} else {
		// TODO: i18n!!
		Dispatcher.forwardEvent(GeofenceEvents.SEND_ERROR_MESSAGE,
				new String[] { "Rules Editor",
						"Could not found any associated rule!" });
	}
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:29,代码来源:RulesView.java


示例6: onEditRowUpdateRuleDetails

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
/**
 * On edit rule update details.
 * 
 * @param event
 *            the event
 */
private void onEditRowUpdateRuleDetails(AppEvent event) {
	if ((event.getData() != null) && (event.getData() instanceof RuleModel)) {
		this.ruleRowEditor.reset();
		this.ruleRowEditor.status = "UPDATE";
		showPanel(event);

	} else if ((event.getData() != null)
			&& (event.getData() instanceof GridStatus)) {
		this.ruleRowEditor.reset();
		this.ruleRowEditor.parentGrid = ((GridStatus) event.getData())
				.getGrid();
		this.ruleRowEditor.model = ((GridStatus) event.getData())
				.getModel();
		this.ruleRowEditor.status = "UPDATE";
		showPanelData(event);

	} else {
		// TODO: i18n!!
		Dispatcher.forwardEvent(GeofenceEvents.SEND_ERROR_MESSAGE,
				new String[] { "Rules Editor",
						"Could not found any associated rule!" });
	}
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:30,代码来源:RulesView.java


示例7: onRuleCustomPropAdd

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
/**
 * On rule custom prop add.
 * 
 * @param event
 *            the event
 */
private void onRuleCustomPropAdd(AppEvent event) {
	if (event.getData() != null) {
		LayerCustomPropsTabItem layersCustomPropsItem = (LayerCustomPropsTabItem) this.ruleEditorDialog
				.getTabWidget()
				.getItemByItemId(
						RuleDetailsEditDialog.RULE_LAYER_CUSTOM_PROPS_DIALOG_ID);
		final LayerCustomPropsGridWidget layerCustomPropsInfo = layersCustomPropsItem
				.getLayerCustomPropsWidget().getLayerCustomPropsInfo();
		LayerCustomProps model = new LayerCustomProps();
		model.setPropKey("_new");
		layerCustomPropsInfo.getStore().add(model);

		layerCustomPropsInfo.getGrid().repaint();
	} else {
		// TODO: i18n!!
		Dispatcher.forwardEvent(GeofenceEvents.SEND_ERROR_MESSAGE,
				new String[] { "Rules Details Editor",
						"Could not found any associated rule!" });
	}
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:27,代码来源:RulesView.java


示例8: initialize

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
@Override
protected void initialize()
{
    this.loginWidget = new LoginWidget();

    this.loginWidget.addListener(Events.Hide, new Listener<WindowEvent>()
        {

            public void handleEvent(WindowEvent be)
            {
                Dispatcher.forwardEvent(GeofenceEvents.INIT_GEOFENCE_MAIN_UI);
                loginWidget.reset();
            }
        });

    initWidget();
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:18,代码来源:LoginController.java


示例9: onLogout

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
/**
 * On logout.
 */
private void onLogout()
{
    this.loginRemote.logout(new AsyncCallback<Void>()
        {

            public void onFailure(Throwable caught)
            {
                Dispatcher.forwardEvent(GeofenceEvents.SEND_ERROR_MESSAGE,
                    new String[] { "Logout Service", "There was an error in logout" });
            }

public void onSuccess(Void result) {
	Dispatcher.forwardEvent(GeofenceEvents.SESSION_EXPIRED);
}

        });

}
 
开发者ID:geoserver,项目名称:geofence,代码行数:22,代码来源:LoginController.java


示例10: onShowLoginWidget

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
/**
 * On show login widget.
 */
private void onShowLoginWidget()
{
    this.loginRemote.isAuthenticated(new AsyncCallback<Boolean>()
        {

            public void onFailure(Throwable caught)
            {
                loginWidget.show();
            }

            public void onSuccess(Boolean result)
            {
                if (!result)
                {
                    loginWidget.show();
                }
                else
                {
                    loginWidget.hide();
                    Dispatcher.forwardEvent(GeofenceEvents.INIT_GEOFENCE_MAIN_UI);
                }
            }

        });
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:29,代码来源:LoginController.java


示例11: execute

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
public void execute() {
    this.saveStatus.setBusy("Operation in progress");

    if (status.equals("UPDATE")) {
        Dispatcher.forwardEvent(GeofenceEvents.RULE_SAVE, model);
        onExecute = true;
    } else {
        Dispatcher.forwardEvent(GeofenceEvents.RULE_ADD, model);
        onExecute = true;
    }

    if (this.closeOnSubmit) {
        cancel();
    }

    this.injectEvent();
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:18,代码来源:EditRuleWidget.java


示例12: handleEvent

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
public void handleEvent(GridEvent<RuleModel> be) {

            Dispatcher.forwardEvent(GeofenceEvents.SEND_INFO_MESSAGE,
                new String[]{"DEBUG","Resizing " + be.getGrid().getColumnModel().getColumnId(be.getColIndex())});

            for (int i = 0; i < be.getGrid().getStore().getCount(); i++) { // there should be only 1 row

                // let's force a resize on all the columns
                for (int col = 0; col < be.getGrid().getColumnModel().getColumnCount(); col++) {

//                    final Widget widget = be.getGrid().getView().getWidget(i, be.getColIndex());

                    final Widget widget = be.getGrid().getView().getWidget(i, col);

//                    Dispatcher.forwardEvent(GeofenceEvents.SEND_INFO_MESSAGE,
//                        new String[]{"DEBUG","Resizing " + widget.getClass().getName() + "--" + widget.getTitle()});

                    int colWidth = be.getGrid().getColumnModel().getColumn(col).getWidth();

                    if ((widget != null) && (widget instanceof BoxComponent)) {
//                        ((BoxComponent) widget).setWidth(be.getWidth() - offset);
                        ((BoxComponent) widget).setWidth(colWidth - offset);
                    }
                }
            }
        }
 
开发者ID:geoserver,项目名称:geofence,代码行数:27,代码来源:EditRuleWidget.java


示例13: resetComponents

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
/**
 * Reset components.
 */
public void resetComponents()
{
    if ((grid != null) && (grid.getStore() != null))
    {
        this.grid.getStore().removeAll();
    }

    this.saveStatus.clearStatus("");

    if (!this.onExecute)
    {
        Dispatcher.forwardEvent(GeofenceEvents.LOAD_RULES);
    }

    this.onExecute = false;
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:20,代码来源:EditRuleWidget.java


示例14: createFormPanel

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
/**
 * Creates the form panel.
 */
private void createFormPanel()
{
    formPanel = new FormPanel();
    formPanel.setFrame(true);
    formPanel.setHeaderVisible(false);
    formPanel.setAutoHeight(true);

    FieldSet fieldSet = new FieldSet();
    fieldSet.setHeading("Search Management");
    fieldSet.setCheckboxToggle(false);
    fieldSet.setCollapsible(false);

    FormLayout layout = new FormLayout();
    fieldSet.setLayout(layout);

    search = new Button("Search", new SelectionListener<ButtonEvent>()
            {

                @Override
                public void componentSelected(ButtonEvent ce)
                {
                    Dispatcher.forwardEvent(GeofenceEvents.SHOW_SEARCH_USER_WIDGET);
                }
            });

    ButtonBar bar = new ButtonBar();
    bar.setAlignment(HorizontalAlignment.CENTER);

    bar.add(search);

    Button p = new Button("get AOIs");

    Button q = new Button("get Features");

    bar.add(p);
    bar.add(q);

    fieldSet.add(bar);

    formPanel.add(fieldSet);
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:45,代码来源:UserSearchComponent.java


示例15: RuleLimitsTabItem

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
/**
 * Instantiates a new rule details tab item.
 * 
 * @param tabItemId
 *            the tab item id
 * @param model
 *            the model
 * @param loadModel
 * @param workspacesService
 *            the workspaces service
 */
public RuleLimitsTabItem(String tabItemId, RuleModel model,
		RulesManagerRemoteServiceAsync rulesService, boolean loadModel) {
	this(tabItemId);
	this.theRule = model;

	setRuleLimitsWidget(new RuleLimitsWidget(this.theRule, rulesService));
	add(getRuleLimitsWidget());

	setScrollMode(Scroll.NONE);

	if (loadModel) {
		this.addListener(Events.Select, new Listener<BaseEvent>() {

			public void handleEvent(BaseEvent be) {
				if (ruleLimitsWidget.getRuleLimitsInfo().getModel() == null) {
					Dispatcher.forwardEvent(
							GeofenceEvents.LOAD_LAYER_LIMITS, theRule);
				}
			}

		});
	}

}
 
开发者ID:geoserver,项目名称:geofence,代码行数:36,代码来源:RuleLimitsTabItem.java


示例16: setGridProperties

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
@Override
public void setGridProperties() {
	grid.setHeight(Constants.SOUTH_PANEL_DIMENSION - 25);

	if (grid.getStore() != null) {
		grid.getStore().setSortField(BeanKeyValue.PRIORITY.getValue());
		grid.getStore().setSortDir(SortDir.ASC);
	}

	grid.addListener(Events.RowDoubleClick,
			new Listener<GridEvent<RuleModel>>() {
				public void handleEvent(GridEvent<RuleModel> be) {
					RuleModel ruleModel = be.getModel();
					Dispatcher.forwardEvent(
							GeofenceEvents.EDIT_RULE_UPDATE,
							new GridStatus(grid, ruleModel));
				}
			});
}
 
开发者ID:geoserver,项目名称:geofence,代码行数:20,代码来源:RuleGridWidget.java


示例17: getMenuItem

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的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);
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:37,代码来源:DesktopMenuFactory.java


示例18: updateShortcuts

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的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);
		}
	}
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:35,代码来源:DesktopMenuFactory.java


示例19: showRegisterWindow

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
protected void showRegisterWindow() {
	CMDBDesktopMenuItem regItem = new CMDBDesktopMenuItem();
	CMDBDesktopWindowItem wItem = new CMDBDesktopWindowItem();
	wItem.setID(CMDBURLFrameWidget.ID);
	wItem.setHeading("Register to OneCMDB");
	wItem.setWidth("600px");
	BaseModel params = new BaseModel();
	params.set("url", "http://www.onecmdb.org/reg/reg.php?id=" + CMDBSession.get().getInstallId());
	wItem.setParams(params);
	regItem.getWindowItem(wItem);
	Dispatcher.get().dispatch(new AppEvent<CMDBDesktopMenuItem>(CMDBEvents.DESKTOP_MENU_SELECTED, regItem ));
}
 
开发者ID:luox12,项目名称:onecmdb,代码行数:13,代码来源:DesktopContoller.java


示例20: onModuleLoad

import com.extjs.gxt.ui.client.mvc.Dispatcher; //导入依赖的package包/类
public void onModuleLoad()
    {
        dispatcher = Dispatcher.get();

        dispatcher.addController(new MapController());
        dispatcher.addController(new MAPSController());
        // dispatcher.addController(new FeatureController());
//        dispatcher.addController(new FilterController());

        dispatcher.dispatch(GeofenceEvents.INIT_MAPS_UI_MODULE);

    }
 
开发者ID:geoserver,项目名称:geofence,代码行数:13,代码来源:MAPSUI.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java View类代码示例发布时间:2022-05-22
下一篇:
Java XLogPack类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap