Java Doc for BookmarkFolder.java in  » Database-Client » iSQL-Viewer » org » isqlviewer » bookmarks » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database Client » iSQL Viewer » org.isqlviewer.bookmarks 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.isqlviewer.bookmarks.BookmarkFolder

BookmarkFolder
public class BookmarkFolder implements Serializable(Code)
Folder component for representing a collection of bookmarks and bookmark folders.

This object is the basis of creating a bookmark tree. This component is modeled loosly after the java.io.File object since bookmarks are organized in similar fashion to files.
author:
   Mark A. Kobold <mkobold at isqlviewer dot com>
version:
   1.0



Field Summary
final public static  intTYPE_NORMAL
     This bookmark folder is the regular folder that has no special function.
final public static  intTYPE_ROOT
     This bookmark folder is the root of the folder tree, and this folder has no parent.
final public static  intTYPE_SMART
     This bookmark folder is folder that has dynamic contents based on other variables.

Constructor Summary
public  BookmarkFolder(String folderName)
     Creates a new bookmark using the specified parent.
 BookmarkFolder(String folderName, int type)
     Constructor for creating new instance of a bookmark.
 BookmarkFolder(BookmarkFolder parentFolder, String folderName)
     Constructor for creating new instance of a bookmark.

Method Summary
public  voidaddBookmark(BookmarkReference bookmark)
     Adds a bookmark to this folder.
public  BookmarkFolderaddChildFolder(String folderName)
     Adds a child folder to this instance.
public  Enumeration<Object>childElements()
     Enumeration for processing all child elements of this folder.
public  booleancontainsBookmark(String bookmarkName)
    
public static  BookmarkFoldercreateRootFolder()
     Creates a new root folder for creating a new bookmark tree.
public  BookmarkFolderfindChildPath(String childPath)
     Searches for a folder using the specified path.

Assumes that the given path precedes the given path.
Parameters:
  childPath - to search for within this folder.

public  ObjectgetChild(int index)
     Gets the child component by index.

This method is here to mainly support the use of this object within the Swing TreeModel.
Parameters:
  index - of the child component to get.

public  intgetChildCount()
     Gets the number of child components that exist within this instance.
public  StringgetName()
     Gets the user-specific name for this folder.

This value can be null if no name has been set.

public  StringgetParent()
     Gets the name of the parent folder for this folder.
public  BookmarkFoldergetParentFolder()
     Gets the parent folder this folder was created with.
public  StringgetPath()
     Gets the full path of this folder.
public static  BookmarkFolder[]getPathElements(BookmarkFolder folder)
    
public  intgetType()
     Gets the type of folder this instance is.
public  intindexOfChild(Object child)
     Returns the index of the child component.

This method is here to mainly support the use of this object within the Swing TreeModel.
Parameters:
  child - to get the index of.

public  String[]list()
     Returns a string list of all the names of the folders and bookmarks in this folder.

This will return a list of all folders and bookmark names contained in this folder.

public  BookmarkFoldermkdirs(String childPath)
    
public  booleanremoveBookmark(BookmarkReference bookmark)
     Removes a bookmark from the folder it resides within.

This method can technically be called on any folder, so the bookmark does not have to actually exist in this folder instance to be removed from its parent folder.

If a null bookmark is given this method immediately returns false.
Parameters:
  bookmark - to remove from its parent folder.

public  booleanremoveFolder(BookmarkFolder folder)
     Removes a child folder from this instance.

Unlike the remove bookmark method this method cannot be called anywhere and the given folder must exist in this instance.

If a null bookmark is given this method immediately returns false.
Parameters:
  folder - to remove from this instance.

public  voidsetName(String name)
     Changes the name of this folder.
public  StringtoString()
    

Field Detail
TYPE_NORMAL
final public static int TYPE_NORMAL(Code)
This bookmark folder is the regular folder that has no special function.


See Also:   BookmarkFolder.getType()




TYPE_ROOT
final public static int TYPE_ROOT(Code)
This bookmark folder is the root of the folder tree, and this folder has no parent.


See Also:   BookmarkFolder.getType()




TYPE_SMART
final public static int TYPE_SMART(Code)
This bookmark folder is folder that has dynamic contents based on other variables.


See Also:   BookmarkFolder.getType()





Constructor Detail
BookmarkFolder
public BookmarkFolder(String folderName)(Code)
Creates a new bookmark using the specified parent.

The folder created by this method will already be added to the parent folder.
Parameters:
  folderName - of this new folder.
throws:
  IllegalArgumentException - is null parentFolder is given.




BookmarkFolder
BookmarkFolder(String folderName, int type)(Code)
Constructor for creating new instance of a bookmark.


Parameters:
  folder - parent folder for this folder instance if any.
Parameters:
  type - the type of folder it actually is.
throws:
  IllegalArgumentException - if the type is not root and foler is null.




BookmarkFolder
BookmarkFolder(BookmarkFolder parentFolder, String folderName)(Code)
Constructor for creating new instance of a bookmark.


Parameters:
  folder - parent folder for this folder instance if any.
Parameters:
  type - the type of folder it actually is.
throws:
  IllegalArgumentException - if the type is not root and foler is null.





Method Detail
addBookmark
public void addBookmark(BookmarkReference bookmark)(Code)
Adds a bookmark to this folder.

The previous folder instance will no longer have the instance of the given bookmark after call.
Parameters:
  bookmark - to be added to this folder.
throws:
  NullPointerException - if the child bookmark is null.




addChildFolder
public BookmarkFolder addChildFolder(String folderName)(Code)
Adds a child folder to this instance.

This method will essentially move the folder from another tree the child folder will be detached from existing parent and added to this parent.

An illegal argument exception will be thrown if one of the following restrictions are broken.

  • TYPE_NORMAL folders can only have other TYPE_NORMAL sub-folders
  • TYPE_SMART folders can have TYPE_NORMAL or TYPE_SMART sub-folders
  • TYPE_ROOT folders can have TYPE_NORMAL or TYPE_SMART sub-folders

Parameters:
  childFolder - to add to this instance.
throws:
  NullPointerException - if the child folder is null.
throws:
  IllegalArgumentException - if child folder has type that is logicall incorrect for this folder.



childElements
public Enumeration<Object> childElements()(Code)
Enumeration for processing all child elements of this folder.

All objects return will be an instance of BookmarkFolder or Bookmark. enumeration of elements contained in this folder.




containsBookmark
public boolean containsBookmark(String bookmarkName)(Code)

Parameters:
  text -



createRootFolder
public static BookmarkFolder createRootFolder()(Code)
Creates a new root folder for creating a new bookmark tree.

new bookmark folder that has a type of BookmarkFolder.TYPE_ROOT.




findChildPath
public BookmarkFolder findChildPath(String childPath)(Code)
Searches for a folder using the specified path.

Assumes that the given path precedes the given path.
Parameters:
  childPath - to search for within this folder. folder based on the path, can be null if child path does not exist.




getChild
public Object getChild(int index)(Code)
Gets the child component by index.

This method is here to mainly support the use of this object within the Swing TreeModel.
Parameters:
  index - of the child component to get. Bookmark or BookmarkFolder at the specified index, can be null if non-existent.
See Also:   javax.swing.tree.TreeModel.getChild(java.lang.Objectint)




getChildCount
public int getChildCount()(Code)
Gets the number of child components that exist within this instance.

This method is here to mainly support the use of this object within the Swing TreeModel. number of sub-folders and bookmarks that exist in this folder.
See Also:   javax.swing.tree.TreeModel.getChildCount(java.lang.Object)




getName
public String getName()(Code)
Gets the user-specific name for this folder.

This value can be null if no name has been set. if this folder is a root folder a simple '/' will be returned. returns the name of this folder.
See Also:   BookmarkFolder.setName(String)




getParent
public String getParent()(Code)
Gets the name of the parent folder for this folder.

If this is a root folder than the folder will null. name of the parent folder.




getParentFolder
public BookmarkFolder getParentFolder()(Code)
Gets the parent folder this folder was created with.

the parent folder of this instance; will be null if this is ROOT folder.




getPath
public String getPath()(Code)
Gets the full path of this folder.

The path will be in a *NIX style convention of '/parent/child/folder/' the path represented by this folder.




getPathElements
public static BookmarkFolder[] getPathElements(BookmarkFolder folder)(Code)



getType
public int getType()(Code)
Gets the type of folder this instance is.

one of the TYPE_XXX constant values defined in this class.
See Also:   BookmarkFolder.TYPE_NORMAL
See Also:   BookmarkFolder.TYPE_ROOT
See Also:   BookmarkFolder.TYPE_SMART




indexOfChild
public int indexOfChild(Object child)(Code)
Returns the index of the child component.

This method is here to mainly support the use of this object within the Swing TreeModel.
Parameters:
  child - to get the index of. index of the child in the list of components; -1 if non-existent.
See Also:   javax.swing.tree.TreeModel.getIndexOfChild(java.lang.Objectjava.lang.Object)




list
public String[] list()(Code)
Returns a string list of all the names of the folders and bookmarks in this folder.

This will return a list of all folders and bookmark names contained in this folder. All folders will be first in the list and will be prefixed with '/'. string list of the names of all components in this folder.




mkdirs
public BookmarkFolder mkdirs(String childPath)(Code)

Parameters:
  string -



removeBookmark
public boolean removeBookmark(BookmarkReference bookmark)(Code)
Removes a bookmark from the folder it resides within.

This method can technically be called on any folder, so the bookmark does not have to actually exist in this folder instance to be removed from its parent folder.

If a null bookmark is given this method immediately returns false.
Parameters:
  bookmark - to remove from its parent folder. true if the bookmark was successfully removed from the folder.




removeFolder
public boolean removeFolder(BookmarkFolder folder)(Code)
Removes a child folder from this instance.

Unlike the remove bookmark method this method cannot be called anywhere and the given folder must exist in this instance.

If a null bookmark is given this method immediately returns false.
Parameters:
  folder - to remove from this instance. true if the child folder was successfully removed from this instance.




setName
public void setName(String name)(Code)
Changes the name of this folder.

Once the name is changed the path name will also be changed.
Parameters:
  name - of the folder to be set.
throws:
  IllegalStateException - if the type of folder is ROOT
throws:
  IllegalArgumentException - if the new name exists in the parent folder.




toString
public String toString()(Code)



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.