1 19 20 25 26 package org.netbeans.modules.css.visual.model; 27 28 import javax.swing.DefaultComboBoxModel ; 29 30 35 public class TextBlockModel { 36 37 public DefaultComboBoxModel getHorizontalAlignmentList(){ 38 return new HorizontalAlignmentList(); 39 } 40 41 public DefaultComboBoxModel getVerticalAlignmentList(){ 42 return new VerticalAlignmentList(); 43 } 44 45 public DefaultComboBoxModel getIndentationList(){ 46 return new IndentationList(); 47 } 48 49 public DefaultComboBoxModel getTextBlockUnitList(){ 50 return new TextBlockUnitList(); 51 } 52 53 public DefaultComboBoxModel getTextDirectionList(){ 54 return new TextDirectionList(); 55 } 56 57 public DefaultComboBoxModel getWordSpacingList(){ 58 return new WordSpacingList(); 59 } 60 61 public DefaultComboBoxModel getLetterSpacingList(){ 62 return new LetterSpacingList(); 63 } 64 65 public DefaultComboBoxModel getLineHeightList(){ 66 return new LineHeightList(); 67 } 68 69 public static class LineHeightList extends DefaultComboBoxModel { 70 public LineHeightList(){ 71 addElement(CssStyleData.NOT_SET); 72 addElement("normal"); addElement("1"); addElement("2"); addElement("3"); addElement("4"); addElement("5"); addElement("6"); addElement("8"); addElement("10"); addElement(CssStyleData.VALUE); 82 } 83 } 84 85 public static class LetterSpacingList extends DefaultComboBoxModel { 86 public LetterSpacingList(){ 87 addElement(CssStyleData.NOT_SET); 88 addElement("1"); addElement("2"); addElement("3"); addElement("4"); addElement("5"); addElement("6"); addElement("8"); addElement("10"); addElement(CssStyleData.VALUE); 97 } 98 } 99 100 public static class WordSpacingList extends DefaultComboBoxModel { 101 public WordSpacingList(){ 102 addElement(CssStyleData.NOT_SET); 103 addElement("1"); addElement("2"); addElement("3"); addElement("4"); addElement("5"); addElement("6"); addElement("8"); addElement("10"); addElement(CssStyleData.VALUE); 112 } 113 } 114 115 public static class IndentationList extends DefaultComboBoxModel { 116 public IndentationList(){ 117 addElement(CssStyleData.NOT_SET); 118 addElement("1"); addElement("2"); addElement("3"); addElement("4"); addElement("5"); addElement("6"); addElement("8"); addElement("10"); addElement(CssStyleData.VALUE); 127 } 128 } 129 130 public static class TextDirectionList extends DefaultComboBoxModel { 131 public TextDirectionList(){ 132 addElement(CssStyleData.NOT_SET); 133 String [] propValues = CssProperties.getCssPropertyValues(CssProperties.DIRECTION); 134 for(int i=0; i< propValues.length; i++){ 135 addElement(propValues[i]); 136 } 137 } 138 } 139 140 public static class HorizontalAlignmentList extends DefaultComboBoxModel { 141 public HorizontalAlignmentList(){ 142 addElement(CssStyleData.NOT_SET); 143 String [] propValues = CssProperties.getCssPropertyValues(CssProperties.TEXT_ALIGN); 144 for(int i=0; i< propValues.length; i++){ 145 addElement(propValues[i]); 146 } 147 } 148 } 149 150 public static class VerticalAlignmentList extends DefaultComboBoxModel { 151 public VerticalAlignmentList(){ 152 addElement(CssStyleData.NOT_SET); 153 String [] propValues = CssProperties.getCssPropertyValues(CssProperties.VERTICAL_ALIGN); 154 for(int i=0; i< propValues.length; i++){ 155 addElement(propValues[i]); 156 } 157 } 158 } 159 160 public static class TextBlockUnitList extends DefaultComboBoxModel { 161 public TextBlockUnitList(){ 162 String [] unitValues = CssProperties.getCssLengthUnits(); 163 for(int i=0; i< unitValues.length; i++){ 164 addElement(unitValues[i]); 165 } 166 } 167 } 168 169 } 170 | Popular Tags |