// not have a maximum page size but an explicit limit has been set
// on this pane then we need to generate markup and remember that
// we need to dissect the page's contents.
String value;
boolean dissectionNeeded = true;
DissectingPane pane = attributes.getDissectingPane();
String maxContentSize;
if (!isDissecting()) {
if (logger.isDebugEnabled()) {
logger.debug("Dissecting not required for total page " +
"size but may be required for this pane");
}
if ((maxContentSize = pane.getMaximumContentSize()) == null) {
if (logger.isDebugEnabled()) {
logger.debug("Dissecting not required for this pane");
}
dissectionNeeded = false;
}
} else {
if (logger.isDebugEnabled()) {
logger.debug("Dissecting required");
}
maxContentSize = pane.getMaximumContentSize();
}
if (logger.isDebugEnabled()) {
logger.debug("Maximum content size is set to " +
maxContentSize);
}
if (dissectionNeeded) {
// Dissection is needed because we are generating mark up for a
// dissecting pane.
setDissectionNeeded(true);
Element element = dom.openElement(DISSECTABLE_CONTENTS_ELEMENT);
addCoreAttributes(element, attributes);
Element parent = element.getParent();
if (parent != null && parent.getStyles() != null) {
element.setStyles(StylingFactory.getDefaultInstance()
.createInheritedStyles(parent.getStyles(), null));
if (logger.isDebugEnabled()) {
logger.debug("Setting parent styles");
}
}
if ((value = attributes.getInclusionPath()) != null) {
element.setAttribute(INCLUSION_PATH_ATTRIBUTE, value);
}
element.setAttribute(DISSECTING_PANE_NAME_ATTRIBUTE,
pane.getName());
// if ((value = attributes.getStyleClass()) != null) {
// element.setAttribute(DISSECTING_PANE_CLASS_ATTRIBUTE,
// value);
// }
if ((value = pane.getNextShardShortcut()) != null) {
element.setAttribute(NEXT_SHARD_SHORTCUT_ATTRIBUTE,
value);
}
if ((value = attributes.getLinkText()) != null) {
element.setAttribute(NEXT_SHARD_LINK_TEXT_ATTRIBUTE,
value);
} else if(( value = pane.getNextShardLinkText()) != null ) {
element.setAttribute (NEXT_SHARD_LINK_TEXT_ATTRIBUTE,
value);
}
if ((value = pane.getPreviousShardShortcut()) != null) {
element.setAttribute(PREVIOUS_SHARD_SHORTCUT_ATTRIBUTE,
value);
}
if ((value = attributes.getBackLinkText()) != null) {
element.setAttribute(PREVIOUS_SHARD_LINK_TEXT_ATTRIBUTE,
value);
} else if(( value = pane.getPreviousShardLinkText()) != null ) {
element.setAttribute (PREVIOUS_SHARD_LINK_TEXT_ATTRIBUTE, value);
}
// set the GENERATE_NEXT_LINK_FIRST_ATTRIBUTE attribute
// the DissectingPaneAttributes isNextLinkFirst() method