KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > css > visual > model > TextBlockModel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 /*
21  * TextBlockModel.java
22  *
23  * Created on October 29, 2004, 10:30 AM
24  */

25
26 package org.netbeans.modules.css.visual.model;
27
28 import javax.swing.DefaultComboBoxModel JavaDoc;
29
30 /**
31  * Model for the Text Block Style Editor data
32  * @author Winston Prakash
33  * @version 1.0
34  */

35 public class TextBlockModel {
36
37     public DefaultComboBoxModel JavaDoc getHorizontalAlignmentList(){
38         return new HorizontalAlignmentList();
39     }
40
41     public DefaultComboBoxModel JavaDoc getVerticalAlignmentList(){
42         return new VerticalAlignmentList();
43     }
44
45     public DefaultComboBoxModel JavaDoc getIndentationList(){
46         return new IndentationList();
47     }
48
49     public DefaultComboBoxModel JavaDoc getTextBlockUnitList(){
50         return new TextBlockUnitList();
51     }
52
53     public DefaultComboBoxModel JavaDoc getTextDirectionList(){
54         return new TextDirectionList();
55     }
56
57     public DefaultComboBoxModel JavaDoc getWordSpacingList(){
58         return new WordSpacingList();
59     }
60
61     public DefaultComboBoxModel JavaDoc getLetterSpacingList(){
62         return new LetterSpacingList();
63     }
64
65     public DefaultComboBoxModel JavaDoc getLineHeightList(){
66         return new LineHeightList();
67     }
68
69     public static class LineHeightList extends DefaultComboBoxModel JavaDoc{
70         public LineHeightList(){
71             addElement(CssStyleData.NOT_SET);
72             addElement("normal"); //NOI18N
73
addElement("1"); //NOI18N
74
addElement("2"); //NOI18N
75
addElement("3"); //NOI18N
76
addElement("4"); //NOI18N
77
addElement("5"); //NOI18N
78
addElement("6"); //NOI18N
79
addElement("8"); //NOI18N
80
addElement("10"); //NOI18N
81
addElement(CssStyleData.VALUE);
82         }
83     }
84
85     public static class LetterSpacingList extends DefaultComboBoxModel JavaDoc{
86         public LetterSpacingList(){
87             addElement(CssStyleData.NOT_SET);
88             addElement("1"); //NOI18N
89
addElement("2"); //NOI18N
90
addElement("3"); //NOI18N
91
addElement("4"); //NOI18N
92
addElement("5"); //NOI18N
93
addElement("6"); //NOI18N
94
addElement("8"); //NOI18N
95
addElement("10"); //NOI18N
96
addElement(CssStyleData.VALUE);
97         }
98     }
99
100     public static class WordSpacingList extends DefaultComboBoxModel JavaDoc{
101         public WordSpacingList(){
102             addElement(CssStyleData.NOT_SET);
103             addElement("1"); //NOI18N
104
addElement("2"); //NOI18N
105
addElement("3"); //NOI18N
106
addElement("4"); //NOI18N
107
addElement("5"); //NOI18N
108
addElement("6"); //NOI18N
109
addElement("8"); //NOI18N
110
addElement("10"); //NOI18N
111
addElement(CssStyleData.VALUE);
112         }
113     }
114
115     public static class IndentationList extends DefaultComboBoxModel JavaDoc{
116         public IndentationList(){
117             addElement(CssStyleData.NOT_SET);
118             addElement("1"); //NOI18N
119
addElement("2"); //NOI18N
120
addElement("3"); //NOI18N
121
addElement("4"); //NOI18N
122
addElement("5"); //NOI18N
123
addElement("6"); //NOI18N
124
addElement("8"); //NOI18N
125
addElement("10"); //NOI18N
126
addElement(CssStyleData.VALUE);
127         }
128     }
129
130     public static class TextDirectionList extends DefaultComboBoxModel JavaDoc{
131         public TextDirectionList(){
132             addElement(CssStyleData.NOT_SET);
133             String JavaDoc[] 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 JavaDoc{
141         public HorizontalAlignmentList(){
142             addElement(CssStyleData.NOT_SET);
143             String JavaDoc[] 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 JavaDoc{
151         public VerticalAlignmentList(){
152             addElement(CssStyleData.NOT_SET);
153             String JavaDoc[] 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 JavaDoc{
161         public TextBlockUnitList(){
162             String JavaDoc[] unitValues = CssProperties.getCssLengthUnits();
163             for(int i=0; i< unitValues.length; i++){
164                 addElement(unitValues[i]);
165             }
166         }
167     }
168     
169 }
170
Popular Tags