Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Thienel2016-02-06 10:58:55 -0500
committerFlorian Thienel2016-02-07 04:13:19 -0500
commitdc1d896b295eb850e07d8ea31bba1391ffaa0568 (patch)
tree6a1bf065bc13a83aec0c0049570753a528c6ef33
parent0ced40ab456262ab0a920ad671bf91c7ba0f2cb6 (diff)
downloadorg.eclipse.mylyn.docs.vex-dc1d896b295eb850e07d8ea31bba1391ffaa0568.tar.gz
org.eclipse.mylyn.docs.vex-dc1d896b295eb850e07d8ea31bba1391ffaa0568.tar.xz
org.eclipse.mylyn.docs.vex-dc1d896b295eb850e07d8ea31bba1391ffaa0568.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.java17
1 files changed, 16 insertions, 1 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 9585b6c5..662c71ec 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
@@ -135,7 +135,9 @@ public class CssBasedBoxModelBuilder implements IBoxModelBuilder {
public VisualizeResult visit(final IElement element) {
final Styles styles = styleSheet.getStyles(element);
final Collection<VisualizeResult> childrenResults = traverseChildren(element);
- if (isDisplayedAsBlock(styles)) {
+ if (isListRoot(styles)) {
+ return new VisualizeResult(element, styles, childrenResults, visualizeAsList(element, styles, childrenResults));
+ } else if (isDisplayedAsBlock(styles)) {
return new VisualizeResult(element, styles, childrenResults, visualizeAsBlock(element, styles, childrenResults));
} else {
return new VisualizeResult(element, styles, childrenResults, visualizeInline(element, styles, childrenResults));
@@ -173,6 +175,11 @@ public class CssBasedBoxModelBuilder implements IBoxModelBuilder {
});
}
+ private static boolean isListRoot(final Styles styles) {
+ final String listStyleType = styles.getListStyleType();
+ return listStyleType != null && !CSS.NONE.equals(listStyleType);
+ }
+
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);
@@ -191,6 +198,14 @@ public class CssBasedBoxModelBuilder implements IBoxModelBuilder {
}
/*
+ * Render as List
+ */
+
+ private IStructuralBox visualizeAsList(final INode node, final Styles styles, final Collection<VisualizeResult> childrenResults) {
+ return visualizeAsBlock(node, styles, childrenResults);
+ }
+
+ /*
* Render as Block
*/

Back to the top