Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Thienel2016-02-06 15:31:14 -0500
committerFlorian Thienel2016-02-07 04:13:20 -0500
commit7b6a86f5d0ae288a849049733b051ebbd1430fff (patch)
treee29167c4dfb0bbb49821e660b1c57384ca33cc74
parentb0480abfbf8853fc97e3218fabc5ddef38d8be8a (diff)
downloadorg.eclipse.mylyn.docs.vex-7b6a86f5d0ae288a849049733b051ebbd1430fff.tar.gz
org.eclipse.mylyn.docs.vex-7b6a86f5d0ae288a849049733b051ebbd1430fff.tar.xz
org.eclipse.mylyn.docs.vex-7b6a86f5d0ae288a849049733b051ebbd1430fff.zip
recognize the root of a list
Signed-off-by: Florian Thienel <florian@thienel.org>
-rw-r--r--org.eclipse.vex.core/src/org/eclipse/vex/core/internal/visualization/CssBasedBoxModelBuilder.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/visualization/CssBasedBoxModelBuilder.java b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/visualization/CssBasedBoxModelBuilder.java
index 662c71ec..1a07c307 100644
--- a/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/visualization/CssBasedBoxModelBuilder.java
+++ b/org.eclipse.vex.core/src/org/eclipse/vex/core/internal/visualization/CssBasedBoxModelBuilder.java
@@ -137,6 +137,8 @@ public class CssBasedBoxModelBuilder implements IBoxModelBuilder {
final Collection<VisualizeResult> childrenResults = traverseChildren(element);
if (isListRoot(styles)) {
return new VisualizeResult(element, styles, childrenResults, visualizeAsList(element, styles, childrenResults));
+ } else if (isListItem(styles)) {
+ return new VisualizeResult(element, styles, childrenResults, visualizeAsListItem(element, styles, childrenResults));
} else if (isDisplayedAsBlock(styles)) {
return new VisualizeResult(element, styles, childrenResults, visualizeAsBlock(element, styles, childrenResults));
} else {
@@ -180,6 +182,10 @@ public class CssBasedBoxModelBuilder implements IBoxModelBuilder {
return listStyleType != null && !CSS.NONE.equals(listStyleType);
}
+ private static boolean isListItem(final Styles styles) {
+ return CSS.LIST_ITEM.equals(styles.getDisplay());
+ }
+
private static boolean isDisplayedAsBlock(final Styles styles) {
// currently we can only render blocks or inline, hence everything that is not inline must be a block
return !isDisplayedInline(styles);
@@ -206,6 +212,14 @@ public class CssBasedBoxModelBuilder implements IBoxModelBuilder {
}
/*
+ * Render as ListItem
+ */
+
+ private IStructuralBox visualizeAsListItem(final INode node, final Styles styles, final Collection<VisualizeResult> childrenResults) {
+ return visualizeAsBlock(node, styles, childrenResults);
+ }
+
+ /*
* Render as Block
*/

Back to the top