1 17 18 19 20 package org.apache.fop.render.rtf.rtflib.rtfdoc; 21 22 28 29 35 36 public class ParagraphKeeptogetherContext { 37 38 private static int paraKeepTogetherOpen = 0; 39 private static boolean paraResetProperties = false; 40 private static ParagraphKeeptogetherContext instance = null; 41 42 ParagraphKeeptogetherContext() { 43 } 44 45 46 51 public static ParagraphKeeptogetherContext getInstance() { 52 if (instance == null) { 53 instance = new ParagraphKeeptogetherContext(); 54 } 55 return instance; 56 } 57 58 61 public static int getKeepTogetherOpenValue() { 62 return paraKeepTogetherOpen; 63 } 64 65 66 public static void keepTogetherOpen() { 67 paraKeepTogetherOpen++; 68 } 69 70 71 public static void keepTogetherClose() { 72 if (paraKeepTogetherOpen > 0) { 73 paraKeepTogetherOpen--; 74 75 paraResetProperties = (paraKeepTogetherOpen == 0); 79 } 80 } 81 82 85 public static boolean paragraphResetProperties() { 86 return paraResetProperties; 87 } 88 89 90 public static void setParagraphResetPropertiesUsed() { 91 paraResetProperties = false; 92 } 93 94 } 95 | Popular Tags |