KickJava   Java API By Example, From Geeks To Geeks.

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


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  * PositionModel.java
22  *
23  * Created on October 29, 2004, 12:33 PM
24  */

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

35 public class PositionModel {
36  
37     public DefaultComboBoxModel JavaDoc getModeList(){
38         return new ModeList();
39     }
40
41     public DefaultComboBoxModel JavaDoc getPositionList(){
42         return new PositionList();
43     }
44
45     public DefaultComboBoxModel JavaDoc getPositionUnitList(){
46         return new PositionUnitList();
47     }
48
49     public DefaultComboBoxModel JavaDoc getSizeList(){
50         return new SizeList();
51     }
52
53     public DefaultComboBoxModel JavaDoc getZIndexList(){
54         return new ZIndexList();
55     }
56
57     public DefaultComboBoxModel JavaDoc getVisibilityList(){
58         return new VisibilityList();
59     }
60
61     public static class PositionList extends DefaultComboBoxModel JavaDoc{
62         public PositionList(){
63             addElement(CssStyleData.NOT_SET);
64             addElement("1"); //NOI18N
65
addElement("2"); //NOI18N
66
addElement("3"); //NOI18N
67
addElement("4"); //NOI18N
68
addElement("5"); //NOI18N
69
addElement("6"); //NOI18N
70
addElement("8"); //NOI18N
71
addElement("10"); //NOI18N
72
addElement(CssStyleData.VALUE);
73         }
74     }
75
76     public static class SizeList extends DefaultComboBoxModel JavaDoc{
77         public SizeList(){
78             addElement(CssStyleData.NOT_SET);
79             addElement("1"); //NOI18N
80
addElement("2"); //NOI18N
81
addElement("3"); //NOI18N
82
addElement("4"); //NOI18N
83
addElement("5"); //NOI18N
84
addElement("6"); //NOI18N
85
addElement("8"); //NOI18N
86
addElement("10"); //NOI18N
87
addElement(CssStyleData.VALUE);
88         }
89     }
90
91     public static class ModeList extends DefaultComboBoxModel JavaDoc{
92         public ModeList(){
93             addElement(CssStyleData.NOT_SET);
94             String JavaDoc[] propValues = CssProperties.getCssPropertyValues(CssProperties.POSITION);
95             for(int i=0; i< propValues.length; i++){
96                 addElement(propValues[i]);
97             }
98         }
99     }
100
101     public static class ZIndexList extends DefaultComboBoxModel JavaDoc{
102         public ZIndexList(){
103             addElement(CssStyleData.NOT_SET);
104             addElement("1"); //NOI18N
105
addElement("2"); //NOI18N
106
addElement("3"); //NOI18N
107
addElement("4"); //NOI18N
108
addElement("5"); //NOI18N
109
addElement("6"); //NOI18N
110
addElement("8"); //NOI18N
111
addElement("10"); //NOI18N
112
addElement(CssStyleData.VALUE);
113         }
114     }
115
116     public static class VisibilityList extends DefaultComboBoxModel JavaDoc{
117         public VisibilityList(){
118             addElement(CssStyleData.NOT_SET);
119             String JavaDoc[] propValues = CssProperties.getCssPropertyValues(CssProperties.VISIBILITY);
120             for(int i=0; i< propValues.length; i++){
121                 addElement(propValues[i]);
122             }
123         }
124     }
125
126     public static class ClipList extends DefaultComboBoxModel JavaDoc{
127         public ClipList(){
128             addElement(CssStyleData.NOT_SET);
129             addElement("1"); //NOI18N
130
addElement("2"); //NOI18N
131
addElement("3"); //NOI18N
132
addElement("4"); //NOI18N
133
addElement("5"); //NOI18N
134
addElement("6"); //NOI18N
135
addElement("8"); //NOI18N
136
addElement("10"); //NOI18N
137
addElement(CssStyleData.VALUE);
138         }
139     }
140
141     public static class PositionUnitList extends DefaultComboBoxModel JavaDoc{
142         public PositionUnitList(){
143             String JavaDoc[] unitValues = CssProperties.getCssLengthUnits();
144             for(int i=0; i< unitValues.length; i++){
145                 addElement(unitValues[i]);
146             }
147         }
148     }
149 }
150
Popular Tags