Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
book-of-vaadin.pdf
Скачиваний:
88
Добавлен:
24.03.2015
Размер:
13.43 Mб
Скачать

Writing a Server-Side Web Application

4.6.3. Styling with CSS

.v-Notification {}

.popupContent {}

.gwt-HTML {} h1 {}

p {}

The notification box is a floating div element under the body element of the page. It has an overall v-Notification style. The content is wrapped inside an element with popupContent style. The caption is enclosed within an h1 element and the description in a p element.

To customize it, add a style for the Notification object with setStyleName("mystyle"), and make the settings in the theme, for example as follows:

.v-Notification.mystyle { background: #FFFF00; border: 10px solid #C00000; color: black;

}

The result is shown, with the icon set earlier in the customization example, in Figure 4.13, “A Styled Notification”.

Figure 4.13. A Styled Notification

4.7. Application Lifecycle

In this section, we look into more technical details of application deployment, user sessions, and UI instance lifecycle. These details are not generally needed for writing Vaadin applications, but may be useful for understanding how they actually work and, especially, in what circumstances their execution ends.

4.7.1. Deployment

Before a Vaadin application can be used, it has to be deployed to a Java web server, as described in Section 4.8, “Deploying an Application”. Deploying reads the web.xml deployment descriptor in the application to register servlets for specific URL paths and loads the classes. Deployment does not yet normally run any code in the application, although static blocks in classes are executed when they are loaded.

Undeploying and Redeploying

Applications are undeployed when the server shuts down, during redeployment, and when they are explicitly undeployed. Undeploying a server-side Vaadin application ends its execution, all application classes are unloaded, and the heap space allocated by the application is freed for garbage-collection.

Styling with CSS

79

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]