Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.jdevimpl.bookmarks
Class BookmarkList

java.lang.Object
  extended by oracle.jdevimpl.bookmarks.BookmarkList
All Implemented Interfaces:
Copyable

public final class BookmarkList
extends java.lang.Object
implements Copyable

The BookmarkList class is the data class for storing a list of bookmarks - it contains public methods for searching for specific bookmarks via URL's. It is also used for persisting a list of code editor bookmarks across JDeveloper sessions.


Constructor Summary
BookmarkList()
          Construct a new default BookmarkList instance.
 
Method Summary
 Bookmark addBookmark(java.net.URL url, int line)
          Utility method which will add the given bookmark to the list if it does not already exist.
 java.lang.Object copyTo(java.lang.Object target)
          Copies the internal state of this object to the specified copy.
 Bookmark findBookmark(java.net.URL url, int line)
          Utility method which will search for a bookmark in the list with the specified url and line number.
 Bookmark[] findBookmarks(java.net.URL url)
          Utility method which will search for all bookmarks in our list matching the specified url.
 Bookmark findNumberedBookmark(int number)
          Return the bookmark with the given number, or null if one doesn't exist
 Bookmark[] getAllBookmarks()
          Utility method to fetch all of the bookmarks in our current list.
 int getBookmarkCount()
          Utility method to fetch the number of bookmarks in our current list.
 java.util.List<Bookmark> getBookmarkList()
          Fetch the list of bookmarks.
 Bookmark getNextBookmark(Bookmark bookmark, boolean thisURLOnly)
          Utility method which will find the next bookmark in our list after the current one, allowing for wrapping around the list.
 Bookmark getNextBookmark(java.net.URL url, int line, boolean thisURLOnly)
          Utility method which will find the next bookmark in our list after the current line in the given url, allowing for wrapping around the list.
 Bookmark getPreviousBookmark(Bookmark bookmark, boolean thisURLOnly)
          Utility method which will find the previous bookmark in our list before the current one, allowing for wrapping around the list.
 Bookmark getPreviousBookmark(java.net.URL url, int line, boolean thisURLOnly)
          Utility method which will find the previous bookmark in our list before the current line in the given url, allowing for wrapping around the list.
 boolean modifyBookmark(Bookmark bookmark, int line)
          Utility method which will modify the line of the specified bookmark for the purposes of keeping the list in sorted order by bookmark.
 void removeAllBookmarks()
          Utility method which will clear all bookmarks from our bookmark list.
 void removeBookmark(Bookmark bookmark)
          Utility method which will remove the specified bookmark from the list if it is present.
 void setBookmarkList(java.util.List<Bookmark> list)
          Sets the list of bookmarks.
 java.lang.String toString()
          Render a human-readable version of this object into a String for debugging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BookmarkList

public BookmarkList()
Construct a new default BookmarkList instance.

Method Detail

toString

public java.lang.String toString()
Render a human-readable version of this object into a String for debugging purposes.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this object

getAllBookmarks

public Bookmark[] getAllBookmarks()
Utility method to fetch all of the bookmarks in our current list.

Returns:
an array of all of the current bookmarks in our list

getBookmarkCount

public int getBookmarkCount()
Utility method to fetch the number of bookmarks in our current list.

Returns:
the count of bookmarks defined

getNextBookmark

public Bookmark getNextBookmark(java.net.URL url,
                                int line,
                                boolean thisURLOnly)
Utility method which will find the next bookmark in our list after the current line in the given url, allowing for wrapping around the list. Returns null if none is found, or if there are no bookmarks defined.

Parameters:
url - the url to start the search from
line - the line to start from
thisURLOnly - whether to only locate bookmarks with this url

getNextBookmark

public Bookmark getNextBookmark(Bookmark bookmark,
                                boolean thisURLOnly)
Utility method which will find the next bookmark in our list after the current one, allowing for wrapping around the list. Return null if none is found.

Parameters:
bookmark - the bookmark to start searching from
thisURLOnly - whether to only locate bookmarks with the same URL as the bookmark we specify

getPreviousBookmark

public Bookmark getPreviousBookmark(java.net.URL url,
                                    int line,
                                    boolean thisURLOnly)
Utility method which will find the previous bookmark in our list before the current line in the given url, allowing for wrapping around the list. Returns null if none is found, or if there are no bookmarks defined.

Parameters:
url - the url to start the search from
line - the line to start from
thisURLOnly - whether to only locate bookmarks with this url

getPreviousBookmark

public Bookmark getPreviousBookmark(Bookmark bookmark,
                                    boolean thisURLOnly)
Utility method which will find the previous bookmark in our list before the current one, allowing for wrapping around the list. Return null if none is found.

Parameters:
bookmark - the bookmark to start searching from
thisURLOnly - whether to only locate bookmarks with the same URL as the bookmark we specify

findBookmarks

public Bookmark[] findBookmarks(java.net.URL url)
Utility method which will search for all bookmarks in our list matching the specified url. Returns a zero-length array if there is no matching bookmarks.

Parameters:
url - the url of the bookmark to search for
Returns:
an array of matching bookmarks, or a zero-length array if none is found

findBookmark

public Bookmark findBookmark(java.net.URL url,
                             int line)
Utility method which will search for a bookmark in the list with the specified url and line number. Returns null if there is no matching bookmark.

Parameters:
url - the url of the bookmark to search for
line - the line of the bookmark to search for
Returns:
the matching bookmark, or null if none is found

addBookmark

public Bookmark addBookmark(java.net.URL url,
                            int line)
Utility method which will add the given bookmark to the list if it does not already exist. If it already exists, the existing bookmark will be returned instead.

Parameters:
url - the url for the bookmark
line - the line of the bookmark

modifyBookmark

public boolean modifyBookmark(Bookmark bookmark,
                              int line)
Utility method which will modify the line of the specified bookmark for the purposes of keeping the list in sorted order by bookmark. This returns true if the modification was successful, or false if a bookmark already exists in the list with the same line and url. In this case (failure), the bookmark being modified will simply be removed from the list and discarded. Note if the specified new line is the same as the old line, nothing will be done, and true will be returned.

Parameters:
bookmark - the bookmark to modify
line - the new line number to set
Returns:
true if the bookmark was successfully modified, or false if it was removed from the list and discarded since another bookmark already exists with the same url and new line

removeBookmark

public void removeBookmark(Bookmark bookmark)
Utility method which will remove the specified bookmark from the list if it is present.

Parameters:
bookmark - the bookmark to remove from the list

removeAllBookmarks

public void removeAllBookmarks()
Utility method which will clear all bookmarks from our bookmark list.


copyTo

public java.lang.Object copyTo(java.lang.Object target)
Copies the internal state of this object to the specified copy.

Specified by:
copyTo in interface Copyable
Parameters:
-
Returns:
The object to which the state of this object was copied. If the target was non-null, then the return value is the same as the target object that was passed in; otherwise, the return value is a new instance of this class.

getBookmarkList

public java.util.List<Bookmark> getBookmarkList()
Fetch the list of bookmarks.

Returns:
the list of bookmarks

setBookmarkList

public void setBookmarkList(java.util.List<Bookmark> list)
Sets the list of bookmarks.

Parameters:
list - the list of bookmarks

findNumberedBookmark

public Bookmark findNumberedBookmark(int number)
Return the bookmark with the given number, or null if one doesn't exist

Parameters:
number -
Returns:

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.