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


Java PushMode类代码示例

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


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

示例1: receiveBroadcast

import com.vaadin.shared.communication.PushMode; //导入依赖的package包/类
@Override
public void receiveBroadcast(final String event) {
	if (ui != null && ui.getSession() != null) { // prevent from detached ui

		// deserialize received message
		final Message message = Message.fromJson(event);

		if (message != null) {
			Long receiverId = message.getReceiverId();

			if (null == userId || null == receiverId || receiverId.equals(userId)) {
				// ok - receive this message
				ui.access(() -> {
					fireEvent(new MessageEvent(message));
					if (PushMode.MANUAL == ui.getPushConfiguration().getPushMode()) {
						try {
							ui.push();
						} catch (Exception e) {
							e.printStackTrace();
						}
					}
				});
			}
		}
	}
}
 
开发者ID:tilioteo,项目名称:hypothesis,代码行数:27,代码来源:SlideContainerPresenter.java

示例2: createDeploymentConfiguration

import com.vaadin.shared.communication.PushMode; //导入依赖的package包/类
@Override
protected DeploymentConfiguration createDeploymentConfiguration(Properties initParameters) {
  return new DefaultDeploymentConfiguration(getClass(), initParameters) {
    @Override
    public String getResourcesPath() {
      return myURLPrefix;
    }

    @Override
    public String getWidgetset(String defaultValue) {
      return "consulo.web.gwt.UI";
    }

    @Override
    public PushMode getPushMode() {
      return PushMode.AUTOMATIC;
    }
  };
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:UIServlet.java

示例3: getPushMode

import com.vaadin.shared.communication.PushMode; //导入依赖的package包/类
@Override
public PushMode getPushMode(UICreateEvent event) {
    WebConfig webConfig = configuration.getConfig(WebConfig.class);

    if (!webConfig.getPushEnabled()) {
        return PushMode.DISABLED;
    }

    return super.getPushMode(event);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:11,代码来源:CubaUIProvider.java

示例4: init

import com.vaadin.shared.communication.PushMode; //导入依赖的package包/类
@Override
protected void init(final VaadinRequest request) {
    broadcastReceiverService = AppContextUtil.getSpringBean(BroadcastReceiverService.class);

    ServerConfiguration serverConfiguration = AppContextUtil.getSpringBean(ServerConfiguration.class);
    if (serverConfiguration.isPush()) {
        getPushConfiguration().setPushMode(PushMode.MANUAL);
    }

    VaadinSession.getCurrent().setErrorHandler(new DefaultErrorHandler() {
        private static final long serialVersionUID = 1L;

        @Override
        public void error(com.vaadin.server.ErrorEvent event) {
            Throwable e = event.getThrowable();
            handleException(request, e);
        }
    });

    setCurrentFragmentUrl(this.getPage().getUriFragment());
    setCurrentContext(new UserUIContext());
    postSetupApp(request);

    EventBusFactory.getInstance().register(new ShellErrorHandler());

    mainWindowContainer = new MainWindowContainer();
    this.setContent(mainWindowContainer);

    getPage().setTitle("MyCollab - Online project management");

    getPage().addUriFragmentChangedListener(uriFragmentChangedEvent -> enter(uriFragmentChangedEvent.getUriFragment()));

    String userAgent = request.getHeader("user-agent");
    if (isInNotSupportedBrowserList(userAgent.toLowerCase())) {
        NotificationUtil.showWarningNotification(UserUIContext.getMessage(ErrorI18nEnum.BROWSER_OUT_UP_DATE));
    }
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:38,代码来源:DesktopApplication.java

示例5: pushMode

import com.vaadin.shared.communication.PushMode; //导入依赖的package包/类
default Optional<PushMode> pushMode() {
    return Optional.empty();
}
 
开发者ID:andyphillips404,项目名称:awplab-core,代码行数:4,代码来源:VaadinProvider.java

示例6: getPushMode

import com.vaadin.shared.communication.PushMode; //导入依赖的package包/类
@Override
public PushMode getPushMode() {
    throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
 
开发者ID:maxschuster,项目名称:Vaadin-SignatureField,代码行数:5,代码来源:TestDeploymentConfiguration.java


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