Red Hat Web Application Framework 6.1 Manual do Utilizador Página 141

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 230
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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
Vista de página 140
1 2 ... 136 137 138 139 140 141 142 143 144 145 146 ... 229 230

Comentários a estes Manuais

Sem comentários