Red Hat Web Application Framework 6.1 Instrukcja Użytkownika Strona 141

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 230
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 140
Chapter 11. Services Tutorials 127
Category movies = new Category("Movies", "long television shows");
// Create the Romantic Comedies category under the Movies category.
Category romance = new Category("Romantic Comedies",
"Comedies with love stories");
romance.setDefaultParentCategory(movies);
// Create the Titanic category under the Romantic Comedies category.
Category titanic = new Category("Titanic", "A category for large movies");
// set this as the default category
titanic.setDefaultParentCategory(romance);
// Create the Drama category under the Movies category.
Category drama = new Category("Drama", "long, not funny stories");
// Make Drama a parent category (but not the default parent) of Titanic.
drama.addChild(titanic);
// Finally, make movies a parent of Drama
drama.setDefaultParentCategory(movies);
Example 11-1. Creating a new category
Przeglądanie stron 140
1 2 ... 136 137 138 139 140 141 142 143 144 145 146 ... 229 230

Komentarze do niniejszej Instrukcji

Brak uwag