//# 0 errors, 32 messages
//#
/*
    //#categoriesview.java:1:1: class: net.sourceforge.pebble.web.view.impl.CategoriesView
    //#categoriesview.java:1:1: method: net.sourceforge.pebble.web.view.impl.CategoriesView.net.sourceforge.pebble.web.view.impl.CategoriesView__static_init
 * Copyright (c) 2003-2006, Simon Brown
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   - Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   - Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in
 *     the documentation and/or other materials provided with the
 *     distribution.
 *
 *   - Neither the name of Pebble nor the names of its contributors may
 *     be used to endorse or promote products derived from this software
 *     without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
package net.sourceforge.pebble.web.view.impl;

import net.sourceforge.pebble.web.view.HtmlView;

/**
 * Represents the list of categories.
 *
 * @author    Simon Brown
 */
public class CategoriesView extends HtmlView {

  private boolean loggedIn = false;

  /**
   * Creates a new instance.
   *
   * @param loggedIn    true if the current user is logged in, false otherwise
   */
  public CategoriesView(boolean loggedIn) {
    //#categoriesview.java:50: method: void net.sourceforge.pebble.web.view.impl.CategoriesView.net.sourceforge.pebble.web.view.impl.CategoriesView(bool)
    //#categoriesview.java:50: Warning: method not available
    //#    -- call on void net.sourceforge.pebble.web.view.HtmlView()
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.view.impl.CategoriesView
    //#    method: void net.sourceforge.pebble.web.view.impl.CategoriesView(bool)
    //#    unanalyzed callee: void net.sourceforge.pebble.web.view.HtmlView()
    //#input(void net.sourceforge.pebble.web.view.impl.CategoriesView(bool)): loggedIn
    //#input(void net.sourceforge.pebble.web.view.impl.CategoriesView(bool)): this
    //#output(void net.sourceforge.pebble.web.view.impl.CategoriesView(bool)): this.loggedIn
    //#post(void net.sourceforge.pebble.web.view.impl.CategoriesView(bool)): this.loggedIn == loggedIn
    //#post(void net.sourceforge.pebble.web.view.impl.CategoriesView(bool)): init'ed(this.loggedIn)
    this.loggedIn = loggedIn;
  }
    //#categoriesview.java:52: end of method: void net.sourceforge.pebble.web.view.impl.CategoriesView.net.sourceforge.pebble.web.view.impl.CategoriesView(bool)

  /**
   * Gets the title of this view.
   *
   * @return the title as a String
   */
  public String getTitle() {
    return getLocalizedString("category.categories");
    //#categoriesview.java:60: method: String net.sourceforge.pebble.web.view.impl.CategoriesView.getTitle()
    //#categoriesview.java:60: Warning: method not available
    //#    -- call on String net.sourceforge.pebble.web.view.impl.CategoriesView:getLocalizedString(String)
    //#    severity: INFORMATIONAL
    //#    class: net.sourceforge.pebble.web.view.impl.CategoriesView
    //#    method: String getTitle()
    //#    unanalyzed callee: String net.sourceforge.pebble.web.view.impl.CategoriesView:getLocalizedString(String)
    //#input(String getTitle()): this
    //#output(String getTitle()): return_value
    //#post(String getTitle()): init'ed(return_value)
    //#categoriesview.java:60: end of method: String net.sourceforge.pebble.web.view.impl.CategoriesView.getTitle()
  }

  /**
   * Gets the URI that this view represents.
   *
   * @return the URI as a String
   */
  public String getUri() {
    if (loggedIn) {
    //#categoriesview.java:69: method: String net.sourceforge.pebble.web.view.impl.CategoriesView.getUri()
    //#input(String getUri()): this
    //#input(String getUri()): this.loggedIn
    //#output(String getUri()): return_value
    //#pre[2] (String getUri()): init'ed(this.loggedIn)
    //#post(String getUri()): return_value in Addr_Set{&".WEB-INF.jsp.viewCategories.jsp",&".WEB-INF.jsp.manageCategories.jsp"}
    //#test_vector(String getUri()): this.loggedIn: {0}, {1}
      return "/WEB-INF/jsp/manageCategories.jsp";
    } else {
      return "/WEB-INF/jsp/viewCategories.jsp";
    //#categoriesview.java:72: end of method: String net.sourceforge.pebble.web.view.impl.CategoriesView.getUri()
    }
  }

}    //#output(net.sourceforge.pebble.web.view.impl.CategoriesView__static_init): __Descendant_Table[net/sourceforge/pebble/web/view/impl/CategoriesView]
    //#output(net.sourceforge.pebble.web.view.impl.CategoriesView__static_init): __Dispatch_Table.getTitle()Ljava/lang/String;
    //#output(net.sourceforge.pebble.web.view.impl.CategoriesView__static_init): __Dispatch_Table.getUri()Ljava/lang/String;
    //#post(net.sourceforge.pebble.web.view.impl.CategoriesView__static_init): __Descendant_Table[net/sourceforge/pebble/web/view/impl/CategoriesView] == &__Dispatch_Table
    //#post(net.sourceforge.pebble.web.view.impl.CategoriesView__static_init): __Dispatch_Table.getTitle()Ljava/lang/String; == &getTitle
    //#post(net.sourceforge.pebble.web.view.impl.CategoriesView__static_init): __Dispatch_Table.getUri()Ljava/lang/String; == &getUri
    //#categoriesview.java:: end of method: net.sourceforge.pebble.web.view.impl.CategoriesView.net.sourceforge.pebble.web.view.impl.CategoriesView__static_init
    //#categoriesview.java:: end of class: net.sourceforge.pebble.web.view.impl.CategoriesView
