Anonymous wrote:
Could you add browser info to main div?
Hi,
The following code determines a browser and adds the corresponding style name to the main window object.
Code:
// Get the client identification string
WebApplicationContext context2 = (WebApplicationContext) getContext();
String browserApplication = context2.getBrowser().getBrowserApplication();
// Add a browser-dependent style name for the main window
if (browserApplication.indexOf("Firefox/2") != -1)
main.addStyleName("firefox2");
// Display the client identification string
main.addComponent(new Label(browserApplication));
We try to avoid such browser-dependent styling and make the default style sheets as browser-independent as possible, so we would not like to add such code unless there is a clear need. It's not very hard to do by youself anyhow, as was done in the above example, and you can do it easily for the specific browsers for which you make the custom styling.