use of org.eclipse.rap.rwt.client.service.ClientInfo in project netxms by netxms.
the class Application method start.
/* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
*/
public Object start(IApplicationContext context) throws Exception {
// $NON-NLS-1$
String lang = getParameter("lang");
if (lang != null)
RWT.setLocale(new Locale(lang));
final Properties properties = new AppPropertiesLoader().load();
int timeout;
try {
timeout = Integer.parseInt(properties.getProperty("sessionTimeout", "600"));
} catch (NumberFormatException e) {
timeout = 600;
}
final Display display = PlatformUI.createDisplay();
RWT.getUISession().getHttpSession().setMaxInactiveInterval(timeout);
display.disposeExec(new Runnable() {
public void run() {
NXCSession session = ConsoleSharedData.getSession();
if (session != null)
session.disconnect();
}
});
ClientInfo clientInfo = RWT.getClient().getService(ClientInfo.class);
if (clientInfo != null) {
// convert offset in minutes to milliseconds (in RAP - means ahead of UTC)
String[] tzList = TimeZone.getAvailableIDs(-clientInfo.getTimezoneOffset() * 60000);
if (tzList.length > 0) {
RWT.getUISession().setAttribute(ConsoleSharedData.ATTRIBUTE_TIMEZONE, TimeZone.getTimeZone(tzList[0]));
}
}
SharedIcons.init(display);
WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
return PlatformUI.createAndRunWorkbench(display, advisor);
}
Aggregations