com.arsdigita.acs.html
Class ContextBar

java.lang.Object
  |
  +--com.arsdigita.acs.html.ContextBar

public class ContextBar
extends Object

Class that displays a Yahoo-style context navbar for a logged-in user, with "your workspace" at the root; or with the system name at the root for non-logged in users.

Elements are added to the context bar in order; each element consists of a path to be used as a relative URL link, and the title to be displayed as a link to that path. The last element added to the context bar is the title of the current page, and a path should not be provided.


Field Summary
static int ADMIN
          Personal "your workspace" context bar for logged-in users and "administration".
static int PERSONAL
          Personal context bar; "your workspace" at root
static int PERSONAL_OR_INDEX
          Personal "your workspace" context bar for logged-in users; points to root /index page for non-logged in users.
 
Constructor Summary
ContextBar()
          Creates a new personal context bar.
ContextBar(int type, UserInfo user)
          Creates a new context bar of the given type, for a given user.
 
Method Summary
 void add(String title)
          Adds a new element to the context bar with no path, for final element.
 void add(String[][] pairs)
          Adds a new element to the context bar with no path, for final element.
 void add(String path, String title)
          Adds a new element to the context bar.
 String getHTML()
          Returns HTML represenation of this context bar.
 String toString()
          Returns HTML represenation of this context bar.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PERSONAL

public static final int PERSONAL
Personal context bar; "your workspace" at root

PERSONAL_OR_INDEX

public static final int PERSONAL_OR_INDEX
Personal "your workspace" context bar for logged-in users; points to root /index page for non-logged in users.

ADMIN

public static final int ADMIN
Personal "your workspace" context bar for logged-in users and "administration".
Constructor Detail

ContextBar

public ContextBar(int type,
                  UserInfo user)
Creates a new context bar of the given type, for a given user.

ContextBar

public ContextBar()
Creates a new personal context bar.
Method Detail

add

public void add(String path,
                String title)
Adds a new element to the context bar.
Parameters:
path - Relative URL to appear in href
title - Title for this page

add

public void add(String title)
Adds a new element to the context bar with no path, for final element.
Parameters:
title - Title for this page

add

public void add(String[][] pairs)
Adds a new element to the context bar with no path, for final element.
Parameters:
title - Title for this page

getHTML

public String getHTML()
Returns HTML represenation of this context bar.
Returns:
HTML context bar

toString

public String toString()
Returns HTML represenation of this context bar.
Overrides:
toString in class Object
Returns:
HTML context bar