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

Mobile Applications with TouchKit

Cache Manifest

The ApplicationCacheSettings object manages the cache manifest, which is used to configure how the browser caches the page and other resources for the web app. See Section 22.7, “Offline Mode” for more details about its use.

22.4.4. The UI

Mobile UIs extend the UI class as usual and construct the user interface from components.

@Theme("mobiletheme")

public class SimplePhoneUI extends UI { @Override

protected void init(VaadinRequest request) {

//Set the window or tab title getPage().setTitle("Hello Phone!");

//Create the content root layout for the UI TabBarView mainView = new TabBarView(); setContent(mainView);

...

}

}

Most commonly, you will use a combination of the major three TouchKit components as the basis of the UI: TabBarView, NavigationView, or NavigationManager.

If a offline UI is provided, it needs to be enabled in the initialization of the UI, as described in Section 22.7, “Offline Mode”.

22.4.5. Mobile Widget Set

TouchKit includes a widget set and therefore requires compiling a project widget set that includes it, as described in Chapter 17, Using Vaadin Add-ons. The project widget set descriptor is automatically generated during the compilation process, whether you use Maven or the Eclipse plugin.

With certain TouhcKit tasks, such as when defining an optimized widget set as described in Section 22.8, “Building an Optimized Widget Set”, you need to provide a hand-modified widget set descriptor. In such case, you need to prevent the automatic generation of the descriptor with the following line in it:

<!-- WS Compiler: manually edited -->

Note that if you have a TouchKit UI in a same project as a non-TouchKit UI, you probably do not want to compile the TouchKit widget set into its widget set. As the automatic generation of the descriptor includes all the widget sets that it finds from the class path, the result can be unwanted. You can use a manually edited descriptor also in that case.

22.5. Mobile User Interface Components

TouchKit introduces a number of components special to mobile user interfaces to give better user interaction and to utilize the special features in mobile devices.

484

The UI

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