diff options
author | Glen Mazza <gmazza@apache.org> | 2005-01-09 12:47:40 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2005-01-09 12:47:40 +0000 |
commit | a2a5e1ea669973db55907af2ad62325b8e776eb5 (patch) | |
tree | affffaa338ea0063a2ec1492d739a980e015e493 /src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java | |
parent | e60c3ee7273dea8fb2c4db97eb248ee5b35972bd (diff) | |
download | xmlgraphics-fop-a2a5e1ea669973db55907af2ad62325b8e776eb5.tar.gz xmlgraphics-fop-a2a5e1ea669973db55907af2ad62325b8e776eb5.zip |
PR:
Obtained from:
Submitted by:
Reviewed by:
1.) New attributeWarning() method added to FONode (needs to be renamed somehow because can this method can also be used for formatting object warnings as well--e.g., unimplemented FO's)
2.) Switch from processNode() -> bind() method for fo:bookmark.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198249 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java')
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java b/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java index dce00e128..634240ac2 100644 --- a/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java +++ b/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java @@ -26,6 +26,7 @@ import org.apache.fop.fo.FObj; import org.apache.fop.fo.FONode; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.ValidationException; +import org.apache.fop.fo.properties.CommonAccessibility; /** @@ -37,8 +38,11 @@ public class Bookmark extends FObj { private BookmarkTitle bookmarkTitle; private ArrayList childBookmarks = new ArrayList(); + // The value of properties relevant for this FO + private CommonAccessibility commonAccessibility; private String internalDestination; private String externalDestination; + // private ToBeImplementedProperty startingState; /** * Create a new bookmark object. @@ -50,27 +54,24 @@ public class Bookmark extends FObj { } /** - * The attributes on the bookmark object are the internal and external - * destination. One of these is required. - * - * @see org.apache.fop.fo.FObj#processNode - * @todo to include all properties of fo:bookmark + * @see org.apache.fop.fo.FObj#bind(PropertyList) */ - public void processNode(String elementName, Locator locator, - Attributes attlist, PropertyList propertyList) throws FOPException - { - internalDestination = - attlist.getValue("internal-destination"); - externalDestination = - attlist.getValue("external-destination"); - if (externalDestination != null && !externalDestination.equals("")) { - getLogger().warn("fo:bookmark external-destination not supported currently."); - } - - if (internalDestination == null || internalDestination.equals("")) { - getLogger().warn("fo:bookmark requires an internal-destination."); + public void bind(PropertyList pList) throws FOPException { + commonAccessibility = pList.getAccessibilityProps(); + externalDestination = pList.get(PR_EXTERNAL_DESTINATION).getString(); + internalDestination = pList.get(PR_INTERNAL_DESTINATION).getString(); + // startingState = pList.get(PR_STARTING_STATE); + + // per spec, internal takes precedence if both specified + if (internalDestination.length() > 0) { + externalDestination = null; + } else if (externalDestination.length() == 0) { + // slightly stronger than spec "should be specified" + attributeError("Missing attribute: Either external-destination or " + + "internal-destination must be specified."); + } else { + attributeWarning("external-destination property not currently supported"); } - } /** |