Package org.albite.book.model.book

Examples of org.albite.book.model.book.Book


        /*
         * try to open the book
         */
        //#debug
        AlbiteMIDlet.LOGGER.log("Trying to open...");
        Book newBook = null;

        newBook = Book.open(bookURL);

        /*
         * All was OK, let's close current book
View Full Code Here


                // write post-action user code here
            } else if (command == EDIT_COMMAND) {//GEN-LINE:|7-commandAction|23|920-preAction
                // write pre-action user code here
                bookmarkAdding = false;

                final Book book = bookCanvas.getCurrentBook();
                final int pos = getBookmarks().getSelectedIndex();
                final Bookmark bookmark =
                        book.getBookmarkManager().bookmarkAt(pos);

                if (bookmark != null) {
                    getBookmarkText().setString(bookmark.getText());
                }
View Full Code Here

            toc.addCommand(getNEXT_COMMAND());
            toc.setCommandListener(this);
            toc.setFitPolicy(Choice.TEXT_WRAP_DEFAULT);
            toc.setSelectCommand(getNEXT_COMMAND());//GEN-END:|325-getter|1|325-postInit
            // write post-init user code here
            final Book book = bookCanvas.getCurrentBook();
            final int count = book.getChaptersCount();
            for (int i = 0; i < count; i++) {
                toc.append(book.getChapter(i).getTitle(), null);
            }
        }//GEN-BEGIN:|325-getter|2|
        return toc;
    }
View Full Code Here

    /**
     * Performs an action assigned to the processBookmark entry-point.
     */
    public void processBookmark() {//GEN-END:|898-entry|0|899-preAction
        // write pre-action user code here
        final Book book = bookCanvas.getCurrentBook();
        final String s = getBookmarkText().getString();

        if (bookmarkAdding) {
            /*
             * Adding a new bookmark
             */
            final Bookmark bookmark =
                    new Bookmark(book.getCurrentChapter(), bookmarkPosition, s);

            final int pos = book.getBookmarkManager().addBookmark(bookmark);

            /*
             * Insert the new bookmark into the list
             */
            getBookmarks().insert(pos, bookmark.getTextForList(), null);
        } else {
            /*
             * Eding the selected bookmark
             */
            final int pos = getBookmarks().getSelectedIndex();

            final Bookmark bookmark =
                    book.getBookmarkManager().bookmarkAt(pos);

             if (bookmark != null) {
                 /*
                  * Update the bookmark
                  */
 
View Full Code Here

     */
    public void deleteBookmark() {//GEN-END:|900-entry|0|901-preAction
        // write pre-action user code here

        final int pos = getBookmarks().getSelectedIndex();
        final Book book = bookCanvas.getCurrentBook();

        if (pos != -1) {
            /*
             * Deleting the bookmark
             */
            book.getBookmarkManager().deleteBookmarkAt(pos);

            /*
             * Delete from the list
             */
            bookmarks.delete(pos);
View Full Code Here

            // write pre-init user code here
            goToBookmarkTask = new SimpleCancellableTask();//GEN-BEGIN:|1067-getter|1|1067-execute
            goToBookmarkTask.setExecutable(new org.netbeans.microedition.util.Executable() {
                public void execute() throws Exception {//GEN-END:|1067-getter|1|1067-execute
                    // write task-execution user code here
                    final Book book = bookCanvas.getCurrentBook();
                    final int pos = getBookmarks().getSelectedIndex();
                    final Bookmark bookmark =
                            book.getBookmarkManager().bookmarkAt(pos);

                    bookCanvas.goToPosition(bookmark);
                }//GEN-BEGIN:|1067-getter|2|1067-postInit
            });//GEN-END:|1067-getter|2|1067-postInit
            // write post-init user code here
View Full Code Here

TOP

Related Classes of org.albite.book.model.book.Book

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.