JAPI 0.9.0
Yet another Java API
API Documentation

net.sf.japi.swing.bookmarks
Class BookmarkManager.BookmarkFolder

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by net.sf.japi.swing.bookmarks.BookmarkManager.Bookmark
          extended by net.sf.japi.swing.bookmarks.BookmarkManager.BookmarkFolder
All Implemented Interfaces:
ActionListener, Serializable, Cloneable, Iterable<BookmarkManager.Bookmark>, EventListener, Action, MutableTreeNode, TreeNode
Enclosing class:
BookmarkManager

public class BookmarkManager.BookmarkFolder
extends BookmarkManager.Bookmark
implements Iterable<BookmarkManager.Bookmark>

Class for Bookmark folders.

Version:
$Id: BookmarkManager.java,v 1.2 2006/03/26 15:22:16 christianhujer Exp $
Author:
Christian Hujer
See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.japi.swing.bookmarks.BookmarkManager.Bookmark
folder
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
BookmarkManager.BookmarkFolder()
          Create a BookmarkFolder without a title.
BookmarkManager.BookmarkFolder(String title)
          Create a BookmarkFolder.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Invoked when an action occurs.
 void add(BookmarkManager.Bookmark bookmark)
          Add a Bookmark to this BookmarkFolder.
 void addBookmark()
          Add a bookmark for the currently selected Question from the currently selected QuestionCollection .
 Enumeration<BookmarkManager.Bookmark> children()
          Returns the children of the receiver as an Enumeration.
 JMenu createMenu()
          Create a MenuItem for this Bookmark
 boolean getAllowsChildren()
          Returns true if the receiver allows children.
 BookmarkManager.Bookmark getChildAt(int childIndex)
          Returns the child TreeNode at index childIndex.
 int getChildCount()
          Returns the number of children TreeNodes the receiver contains.
 int getIndex(TreeNode node)
          Returns the index of node in the receivers children. If the receiver does not contain node, -1 will be returned.
 void insert(BookmarkManager.Bookmark bookmark, int index)
          Insert a Bookmark into this BookmarkFolder.
 void insert(MutableTreeNode child, int index)
          Adds child to the receiver at index. child will be messaged with setParent.
 boolean isLeaf()
          Returns true if the receiver is a leaf.
 Iterator<BookmarkManager.Bookmark> iterator()
          Returns an iterator over a set of elements of type T.
 void newBookmarkFolder()
          Create a new BookmarkFolder.
 void remove(BookmarkManager.Bookmark bookmark)
          Remove a Bookmark from this BookmarkFolder.
 void remove(int index)
          Remove a Bookmark from this BookmarkFolder.
 void remove(MutableTreeNode child)
          Removes node from the receiver. setParent will be messaged on node.
 void setAddBookmarkEnabled(boolean enabled)
          Set the AddBookmark enabled state.
 void store(Node n)
          Store bookmarks in an XML Document.
 
Methods inherited from class net.sf.japi.swing.bookmarks.BookmarkManager.Bookmark
getFolder, getParent, getTitle, removeFromParent, setFolder, setParent, setTitle, setUserObject, toString
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BookmarkManager.BookmarkFolder

public BookmarkManager.BookmarkFolder()
Create a BookmarkFolder without a title. This should only be used for the basic BookmarkFolder containing all other BookmarkItems and BookmarkFolders.


BookmarkManager.BookmarkFolder

public BookmarkManager.BookmarkFolder(String title)
Create a BookmarkFolder.

Parameters:
title - title for BookmarkFolder
Method Detail

iterator

public Iterator<BookmarkManager.Bookmark> iterator()
Returns an iterator over a set of elements of type T.

Specified by:
iterator in interface Iterable<BookmarkManager.Bookmark>
Returns:
an Iterator.

add

public void add(BookmarkManager.Bookmark bookmark)
Add a Bookmark to this BookmarkFolder.

Parameters:
bookmark - Bookmark to add

insert

public void insert(BookmarkManager.Bookmark bookmark,
                   int index)
Insert a Bookmark into this BookmarkFolder.

Parameters:
bookmark - Bookmark to add
index - desired index

remove

public void remove(BookmarkManager.Bookmark bookmark)
Remove a Bookmark from this BookmarkFolder.

Parameters:
bookmark - Bookmark to remove

remove

public void remove(int index)
Remove a Bookmark from this BookmarkFolder.

Specified by:
remove in interface MutableTreeNode
Overrides:
remove in class BookmarkManager.Bookmark
Parameters:
index - Index of Bookmark to remove

createMenu

public JMenu createMenu()
Create a MenuItem for this Bookmark

Specified by:
createMenu in class BookmarkManager.Bookmark
Returns:
MenuItem for this Bookmark

actionPerformed

public void actionPerformed(ActionEvent e)
Invoked when an action occurs.

Specified by:
actionPerformed in interface ActionListener

addBookmark

public void addBookmark()
Add a bookmark for the currently selected Question from the currently selected QuestionCollection .


newBookmarkFolder

public void newBookmarkFolder()
Create a new BookmarkFolder.


setAddBookmarkEnabled

public void setAddBookmarkEnabled(boolean enabled)
Set the AddBookmark enabled state.

Parameters:
enabled - enabled state for AddBookmark action

store

public void store(Node n)
Store bookmarks in an XML Document.

Specified by:
store in class BookmarkManager.Bookmark
Parameters:
n - Node (Element or Document) to attach to

children

public Enumeration<BookmarkManager.Bookmark> children()
Returns the children of the receiver as an Enumeration.

Specified by:
children in interface TreeNode
Overrides:
children in class BookmarkManager.Bookmark

getAllowsChildren

public boolean getAllowsChildren()
Returns true if the receiver allows children.

Specified by:
getAllowsChildren in interface TreeNode
Overrides:
getAllowsChildren in class BookmarkManager.Bookmark

getChildAt

public BookmarkManager.Bookmark getChildAt(int childIndex)
Returns the child TreeNode at index childIndex.

Specified by:
getChildAt in interface TreeNode
Overrides:
getChildAt in class BookmarkManager.Bookmark

getChildCount

public int getChildCount()
Returns the number of children TreeNodes the receiver contains.

Specified by:
getChildCount in interface TreeNode
Overrides:
getChildCount in class BookmarkManager.Bookmark

getIndex

public int getIndex(TreeNode node)
Returns the index of node in the receivers children. If the receiver does not contain node, -1 will be returned.

Specified by:
getIndex in interface TreeNode
Overrides:
getIndex in class BookmarkManager.Bookmark

isLeaf

public boolean isLeaf()
Returns true if the receiver is a leaf.

Specified by:
isLeaf in interface TreeNode
Overrides:
isLeaf in class BookmarkManager.Bookmark

insert

public void insert(MutableTreeNode child,
                   int index)
Adds child to the receiver at index. child will be messaged with setParent.

Specified by:
insert in interface MutableTreeNode
Overrides:
insert in class BookmarkManager.Bookmark

remove

public void remove(MutableTreeNode child)
Removes node from the receiver. setParent will be messaged on node.

Specified by:
remove in interface MutableTreeNode
Overrides:
remove in class BookmarkManager.Bookmark

JAPI
Yet another Java API
API Documentation

© 2005-2006 Christian Hujer. All rights reserved. See copyright