001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041: package org.netbeans.modules.visualweb.propertyeditors.css.model;
042:
043: import javax.swing.DefaultComboBoxModel;
044:
045: /**
046: * Model to hold the presentation data for the Text Block Styles
047: * @author Winston Prakash
048: */
049: public class TextBlockModel {
050:
051: public DefaultComboBoxModel getHorizontalAlignmentList() {
052: return new HorizontalAlignmentList();
053: }
054:
055: public DefaultComboBoxModel getVerticalAlignmentList() {
056: return new VerticalAlignmentList();
057: }
058:
059: public DefaultComboBoxModel getIndentationList() {
060: return new IndentationList();
061: }
062:
063: public DefaultComboBoxModel getTextBlockUnitList() {
064: return new TextBlockUnitList();
065: }
066:
067: public DefaultComboBoxModel getTextDirectionList() {
068: return new TextDirectionList();
069: }
070:
071: public DefaultComboBoxModel getWordSpacingList() {
072: return new WordSpacingList();
073: }
074:
075: public DefaultComboBoxModel getLetterSpacingList() {
076: return new LetterSpacingList();
077: }
078:
079: public DefaultComboBoxModel getLineHeightList() {
080: return new LineHeightList();
081: }
082:
083: public class LineHeightList extends DefaultComboBoxModel {
084: public LineHeightList() {
085: addElement(CssStyleData.NOT_SET);
086: addElement("normal"); //NOI18N
087: addElement("1"); //NOI18N
088: addElement("2"); //NOI18N
089: addElement("3"); //NOI18N
090: addElement("4"); //NOI18N
091: addElement("5"); //NOI18N
092: addElement("6"); //NOI18N
093: addElement("8"); //NOI18N
094: addElement("10"); //NOI18N
095: addElement(CssStyleData.VALUE);
096: }
097: }
098:
099: public class LetterSpacingList extends DefaultComboBoxModel {
100: public LetterSpacingList() {
101: addElement(CssStyleData.NOT_SET);
102: addElement("1"); //NOI18N
103: addElement("2"); //NOI18N
104: addElement("3"); //NOI18N
105: addElement("4"); //NOI18N
106: addElement("5"); //NOI18N
107: addElement("6"); //NOI18N
108: addElement("8"); //NOI18N
109: addElement("10"); //NOI18N
110: addElement(CssStyleData.VALUE);
111: }
112: }
113:
114: public class WordSpacingList extends DefaultComboBoxModel {
115: public WordSpacingList() {
116: addElement(CssStyleData.NOT_SET);
117: addElement("1"); //NOI18N
118: addElement("2"); //NOI18N
119: addElement("3"); //NOI18N
120: addElement("4"); //NOI18N
121: addElement("5"); //NOI18N
122: addElement("6"); //NOI18N
123: addElement("8"); //NOI18N
124: addElement("10"); //NOI18N
125: addElement(CssStyleData.VALUE);
126: }
127: }
128:
129: public class IndentationList extends DefaultComboBoxModel {
130: public IndentationList() {
131: addElement(CssStyleData.NOT_SET);
132: addElement("1"); //NOI18N
133: addElement("2"); //NOI18N
134: addElement("3"); //NOI18N
135: addElement("4"); //NOI18N
136: addElement("5"); //NOI18N
137: addElement("6"); //NOI18N
138: addElement("8"); //NOI18N
139: addElement("10"); //NOI18N
140: addElement(CssStyleData.VALUE);
141: }
142: }
143:
144: public class TextDirectionList extends DefaultComboBoxModel {
145: public TextDirectionList() {
146: addElement(CssStyleData.NOT_SET);
147: addElement("ltr"); //NOI18N
148: addElement("rtl"); //NOI18N
149: }
150: }
151:
152: public class HorizontalAlignmentList extends DefaultComboBoxModel {
153: public HorizontalAlignmentList() {
154: addElement(CssStyleData.NOT_SET);
155: addElement("left"); //NOI18N
156: addElement("right"); //NOI18N
157: addElement("center"); //NOI18N
158: addElement("justify"); //NOI18N
159: }
160: }
161:
162: public class VerticalAlignmentList extends DefaultComboBoxModel {
163: public VerticalAlignmentList() {
164: addElement(CssStyleData.NOT_SET);
165: addElement("baseline"); //NOI18N
166: addElement("sub"); //NOI18N
167: addElement("super"); //NOI18N
168: addElement("top"); //NOI18N
169: addElement("text-top"); //NOI18N
170: addElement("middle"); //NOI18N
171: addElement("bottom"); //NOI18N
172: addElement(CssStyleData.VALUE);
173: }
174: }
175:
176: public class TextBlockUnitList extends DefaultComboBoxModel {
177: public TextBlockUnitList() {
178: addElement("px"); //NOI18N
179: addElement("%"); //NOI18N
180: addElement("in"); //NOI18N
181: addElement("cm"); //NOI18N
182: addElement("mm"); //NOI18N
183: addElement("em"); //NOI18N
184: addElement("ex"); //NOI18N
185: addElement("picas"); //NOI18N
186: }
187: }
188:
189: }
|