Example usage for org.apache.wicket.protocol.http ClientProperties getTimeZone

List of usage examples for org.apache.wicket.protocol.http ClientProperties getTimeZone

Introduction

In this page you can find the example usage for org.apache.wicket.protocol.http ClientProperties getTimeZone.

Prototype

public TimeZone getTimeZone() 

Source Link

Document

Get the client's time zone if that could be detected.

Usage

From source file:jp.xet.uncommons.wicket.utils.TimeZoneUtil.java

License:Apache License

/**
 * ???//from www .j av  a 2  s.  c  om
 * 
 * <p>?JavaScript?????
 * ??JavaScript????{@code null}?????</p>
 * 
 * @return ??????{@code null}
 * @throws IllegalArgumentException ?{@code null}???
 * @since 1.0.0
 */
public static TimeZone getTimeZone() {
    WebClientInfo wci = (WebClientInfo) Session.get().getClientInfo();
    ClientProperties properties = wci.getProperties();
    TimeZone timeZone = properties.getTimeZone();
    return timeZone;
}

From source file:org.bosik.diacomp.web.frontend.wicket.pages.master.MasterPage.java

License:Open Source License

public static TimeZone getTimeZone(Component component) {
    ClientProperties properties = getClientProperties(component);
    TimeZone timeZone = properties.getTimeZone();
    if (timeZone != null) {
        return timeZone;
    } else {/*from  w w  w .j a  va2  s.c  o  m*/
        return TimeZone.getTimeZone("GMT");
    }
}

From source file:org.cast.cwm.service.EventService.java

License:Open Source License

@Override
public LoginSession createLoginSession(Request r) {
    LoginSession loginSession = newLoginSession();
    CwmSession cwmSession = CwmSession.get();
    loginSession.setSessionId(cwmSession.getId());
    loginSession.setStartTime(new Date());
    loginSession.setUser(cwmSession.getUser());
    if (r instanceof ServletWebRequest)
        loginSession.setIpAddress(((ServletWebRequest) r).getContainerRequest().getRemoteAddr());

    loginSession.setCookiesEnabled(false);
    if (cwmSession.getClientInfo() != null) {
        ClientProperties info = cwmSession.getClientInfo().getProperties();
        loginSession.setScreenHeight(info.getBrowserHeight());
        loginSession.setScreenWidth(info.getBrowserWidth());
        if (info.getTimeZone() != null)
            loginSession.setTimezoneOffset(info.getTimeZone().getOffset(new Date().getTime()));
        loginSession.setCookiesEnabled(info.isCookiesEnabled());
        loginSession.setPlatform(info.getNavigatorPlatform());
        loginSession.setUserAgent(cwmSession.getClientInfo().getUserAgent());
        // TODO//from   w w w  .j  a v a 2s. c om
        //loginSession.setflashVersion(flashVersion)
        // isJavaEnabled
    }
    Databinder.getHibernateSession().save(loginSession);

    cwmService.flushChanges();

    // register loginSession with Wicket session
    CwmSession.get().setLoginSessionModel(new HibernateObjectModel<LoginSession>(loginSession));

    return loginSession;
}

From source file:org.hippoecm.frontend.session.UserSession.java

License:Apache License

public TimeZone getTimeZone() {
    final ClientProperties properties = getClientInfo().getProperties();
    TimeZone timeZone = properties.getTimeZone();
    if (timeZone == null) {
        timeZone = TimeZone.getDefault();
    }//from   ww  w  .  ja va2 s  .  c o  m
    return timeZone;
}