Red Hat Web Application Framework 6.1 Uživatelský manuál Strana 141

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 230
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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
Zobrazit stránku 140
1 2 ... 136 137 138 139 140 141 142 143 144 145 146 ... 229 230

Komentáře k této Příručce

Žádné komentáře