KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > css > visual > ui > ListStyleEditor


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

25
26 package org.netbeans.modules.css.visual.ui;
27
28 import org.netbeans.modules.css.visual.model.CssStyleData;
29 import org.openide.util.NbBundle;
30
31 /**
32  * List Style editor.
33  * @author Winston Prakash
34  * @version 1.0
35  */

36 public class ListStyleEditor extends StyleEditor {
37
38     /** Creates new form FontStyleEditor */
39     public ListStyleEditor() {
40         setName("listStyleEditor"); //NOI18N
41
setDisplayName(NbBundle.getMessage(ListStyleEditor.class, "LIST_EDITOR_DISPNAME"));
42         initComponents();
43     }
44
45     /**
46      * Set the CSS Properties Values from the CssStyleData data structure
47      * to the GUI components.
48      */

49     protected void setCssPropertyValues(CssStyleData cssStyleData){
50         removeCssPropertyChangeListener();
51         // Set the values here
52
setCssPropertyChangeListener(cssStyleData);
53     }
54
55     private void initComponents() {//GEN-BEGIN:initComponents
56
java.awt.GridBagConstraints JavaDoc gridBagConstraints;
57
58         previewPanel = new javax.swing.JPanel JavaDoc();
59         previewText = new javax.swing.JLabel JavaDoc();
60         colorPanel = new javax.swing.JPanel JavaDoc();
61         decorationLabel = new javax.swing.JLabel JavaDoc();
62         listTypeCombo = new javax.swing.JComboBox JavaDoc();
63         jLabel1 = new javax.swing.JLabel JavaDoc();
64         jLabel2 = new javax.swing.JLabel JavaDoc();
65         jComboBox1 = new javax.swing.JComboBox JavaDoc();
66         jComboBox2 = new javax.swing.JComboBox JavaDoc();
67         colorButton = new javax.swing.JButton JavaDoc();
68
69         setLayout(new java.awt.GridBagLayout JavaDoc());
70
71         previewPanel.setBorder(new javax.swing.border.TitledBorder JavaDoc("Preview"));
72         previewPanel.setName("");
73         previewText.setText("<preview of the list with a couple items>");
74         previewPanel.add(previewText);
75
76         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
77         gridBagConstraints.gridx = 0;
78         gridBagConstraints.gridy = 1;
79         gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
80         gridBagConstraints.weighty = 1.0;
81         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 10, 10, 10);
82         add(previewPanel, gridBagConstraints);
83
84         colorPanel.setLayout(new java.awt.GridBagLayout JavaDoc());
85
86         decorationLabel.setText("Bullet Icon:");
87         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
88         gridBagConstraints.gridx = 0;
89         gridBagConstraints.gridy = 2;
90         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
91         gridBagConstraints.insets = new java.awt.Insets JavaDoc(10, 0, 0, 10);
92         colorPanel.add(decorationLabel, gridBagConstraints);
93
94         listTypeCombo.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "<Not Set>", "disc", "circle", "square", "decimal (1, 2, 3...)", "lower-roman (i, ii, iii...)", "upper-roman (I, II, III...)", "lower-alpha (a, b, c...)", "upper-alpha (A, B, C...)", "none" }));
95         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
96         gridBagConstraints.gridx = 1;
97         gridBagConstraints.gridy = 0;
98         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
99         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
100         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 0, 0, 0);
101         colorPanel.add(listTypeCombo, gridBagConstraints);
102
103         jLabel1.setText("List Type:");
104         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
105         gridBagConstraints.gridx = 0;
106         gridBagConstraints.gridy = 0;
107         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
108         gridBagConstraints.insets = new java.awt.Insets JavaDoc(5, 0, 0, 10);
109         colorPanel.add(jLabel1, gridBagConstraints);
110
111         jLabel2.setText("Bullet Position");
112         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
113         gridBagConstraints.gridx = 0;
114         gridBagConstraints.gridy = 3;
115         gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
116         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 0, 0, 10);
117         colorPanel.add(jLabel2, gridBagConstraints);
118
119         jComboBox1.setEditable(true);
120         jComboBox1.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "<Not Set>", "<URL>", "none" }));
121         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
122         gridBagConstraints.gridx = 1;
123         gridBagConstraints.gridy = 2;
124         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
125         gridBagConstraints.weightx = 1.0;
126         gridBagConstraints.insets = new java.awt.Insets JavaDoc(10, 0, 0, 0);
127         colorPanel.add(jComboBox1, gridBagConstraints);
128
129         jComboBox2.setEditable(true);
130         jComboBox2.setModel(new javax.swing.DefaultComboBoxModel JavaDoc(new String JavaDoc[] { "<Not Set>", "inside", "outside" }));
131         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
132         gridBagConstraints.gridx = 1;
133         gridBagConstraints.gridy = 3;
134         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
135         gridBagConstraints.weightx = 1.0;
136         gridBagConstraints.insets = new java.awt.Insets JavaDoc(6, 0, 0, 0);
137         colorPanel.add(jComboBox2, gridBagConstraints);
138
139         colorButton.setText("...");
140         colorButton.setMargin(new java.awt.Insets JavaDoc(2, 5, 2, 5));
141         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
142         gridBagConstraints.gridx = 2;
143         gridBagConstraints.gridy = 2;
144         gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
145         gridBagConstraints.insets = new java.awt.Insets JavaDoc(10, 5, 0, 0);
146         colorPanel.add(colorButton, gridBagConstraints);
147
148         gridBagConstraints = new java.awt.GridBagConstraints JavaDoc();
149         gridBagConstraints.gridx = 0;
150         gridBagConstraints.gridy = 0;
151         gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
152         gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
153         gridBagConstraints.weightx = 1.0;
154         gridBagConstraints.insets = new java.awt.Insets JavaDoc(0, 10, 5, 10);
155         add(colorPanel, gridBagConstraints);
156
157     }//GEN-END:initComponents
158

159     // Variables declaration - do not modify//GEN-BEGIN:variables
160
private javax.swing.JButton JavaDoc colorButton;
161     private javax.swing.JPanel JavaDoc colorPanel;
162     private javax.swing.JLabel JavaDoc decorationLabel;
163     private javax.swing.JComboBox JavaDoc jComboBox1;
164     private javax.swing.JComboBox JavaDoc jComboBox2;
165     private javax.swing.JLabel JavaDoc jLabel1;
166     private javax.swing.JLabel JavaDoc jLabel2;
167     private javax.swing.JComboBox JavaDoc listTypeCombo;
168     private javax.swing.JPanel JavaDoc previewPanel;
169     private javax.swing.JLabel JavaDoc previewText;
170     // End of variables declaration//GEN-END:variables
171

172 }
173
Popular Tags