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:
042: /*
043: * ListStyleEditor.java
044: *
045: * Created on October 13, 2004, 12:23 PM
046: */
047:
048: package org.netbeans.modules.css.visual.ui;
049:
050: import org.netbeans.modules.css.editor.model.CssRuleContent;
051: import org.openide.util.NbBundle;
052:
053: /**
054: * List Style editor.
055: * @author Winston Prakash
056: * @version 1.0
057: */
058: public class ListStyleEditor extends StyleEditor {
059:
060: /** Creates new form FontStyleEditor */
061: public ListStyleEditor() {
062: setName("listStyleEditor"); //NOI18N
063: setDisplayName(NbBundle.getMessage(ListStyleEditor.class,
064: "LIST_EDITOR_DISPNAME"));
065: initComponents();
066: }
067:
068: /**
069: * Set the CSS Properties Values from the CssStyleData data structure
070: * to the GUI components.
071: */
072: protected void setCssPropertyValues(CssRuleContent cssStyleData) {
073: removeCssPropertyChangeListener();
074: // Set the values here
075: setCssPropertyChangeListener(cssStyleData);
076: }
077:
078: private void initComponents() {//GEN-BEGIN:initComponents
079: java.awt.GridBagConstraints gridBagConstraints;
080:
081: previewPanel = new javax.swing.JPanel();
082: previewText = new javax.swing.JLabel();
083: colorPanel = new javax.swing.JPanel();
084: decorationLabel = new javax.swing.JLabel();
085: listTypeCombo = new javax.swing.JComboBox();
086: jLabel1 = new javax.swing.JLabel();
087: jLabel2 = new javax.swing.JLabel();
088: jComboBox1 = new javax.swing.JComboBox();
089: jComboBox2 = new javax.swing.JComboBox();
090: colorButton = new javax.swing.JButton();
091:
092: setLayout(new java.awt.GridBagLayout());
093:
094: previewPanel.setBorder(new javax.swing.border.TitledBorder(
095: "Preview"));
096: previewPanel.setName("");
097: previewText
098: .setText("<preview of the list with a couple items>");
099: previewPanel.add(previewText);
100:
101: gridBagConstraints = new java.awt.GridBagConstraints();
102: gridBagConstraints.gridx = 0;
103: gridBagConstraints.gridy = 1;
104: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
105: gridBagConstraints.weighty = 1.0;
106: gridBagConstraints.insets = new java.awt.Insets(5, 10, 10, 10);
107: add(previewPanel, gridBagConstraints);
108:
109: colorPanel.setLayout(new java.awt.GridBagLayout());
110:
111: decorationLabel.setText("Bullet Icon:");
112: gridBagConstraints = new java.awt.GridBagConstraints();
113: gridBagConstraints.gridx = 0;
114: gridBagConstraints.gridy = 2;
115: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
116: gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 10);
117: colorPanel.add(decorationLabel, gridBagConstraints);
118:
119: listTypeCombo.setModel(new javax.swing.DefaultComboBoxModel(
120: new String[] { "<Not Set>", "disc", "circle", "square",
121: "decimal (1, 2, 3...)",
122: "lower-roman (i, ii, iii...)",
123: "upper-roman (I, II, III...)",
124: "lower-alpha (a, b, c...)",
125: "upper-alpha (A, B, C...)", "none" }));
126: gridBagConstraints = new java.awt.GridBagConstraints();
127: gridBagConstraints.gridx = 1;
128: gridBagConstraints.gridy = 0;
129: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
130: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
131: gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0);
132: colorPanel.add(listTypeCombo, gridBagConstraints);
133:
134: jLabel1.setText("List Type:");
135: gridBagConstraints = new java.awt.GridBagConstraints();
136: gridBagConstraints.gridx = 0;
137: gridBagConstraints.gridy = 0;
138: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
139: gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 10);
140: colorPanel.add(jLabel1, gridBagConstraints);
141:
142: jLabel2.setText("Bullet Position");
143: gridBagConstraints = new java.awt.GridBagConstraints();
144: gridBagConstraints.gridx = 0;
145: gridBagConstraints.gridy = 3;
146: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
147: gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 10);
148: colorPanel.add(jLabel2, gridBagConstraints);
149:
150: jComboBox1.setEditable(true);
151: jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(
152: new String[] { "<Not Set>", "<URL>", "none" }));
153: gridBagConstraints = new java.awt.GridBagConstraints();
154: gridBagConstraints.gridx = 1;
155: gridBagConstraints.gridy = 2;
156: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
157: gridBagConstraints.weightx = 1.0;
158: gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 0);
159: colorPanel.add(jComboBox1, gridBagConstraints);
160:
161: jComboBox2.setEditable(true);
162: jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(
163: new String[] { "<Not Set>", "inside", "outside" }));
164: gridBagConstraints = new java.awt.GridBagConstraints();
165: gridBagConstraints.gridx = 1;
166: gridBagConstraints.gridy = 3;
167: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
168: gridBagConstraints.weightx = 1.0;
169: gridBagConstraints.insets = new java.awt.Insets(6, 0, 0, 0);
170: colorPanel.add(jComboBox2, gridBagConstraints);
171:
172: colorButton.setText("...");
173: colorButton.setMargin(new java.awt.Insets(2, 5, 2, 5));
174: gridBagConstraints = new java.awt.GridBagConstraints();
175: gridBagConstraints.gridx = 2;
176: gridBagConstraints.gridy = 2;
177: gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
178: gridBagConstraints.insets = new java.awt.Insets(10, 5, 0, 0);
179: colorPanel.add(colorButton, gridBagConstraints);
180:
181: gridBagConstraints = new java.awt.GridBagConstraints();
182: gridBagConstraints.gridx = 0;
183: gridBagConstraints.gridy = 0;
184: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
185: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
186: gridBagConstraints.weightx = 1.0;
187: gridBagConstraints.insets = new java.awt.Insets(0, 10, 5, 10);
188: add(colorPanel, gridBagConstraints);
189:
190: }//GEN-END:initComponents
191:
192: // Variables declaration - do not modify//GEN-BEGIN:variables
193: private javax.swing.JButton colorButton;
194: private javax.swing.JPanel colorPanel;
195: private javax.swing.JLabel decorationLabel;
196: private javax.swing.JComboBox jComboBox1;
197: private javax.swing.JComboBox jComboBox2;
198: private javax.swing.JLabel jLabel1;
199: private javax.swing.JLabel jLabel2;
200: private javax.swing.JComboBox listTypeCombo;
201: private javax.swing.JPanel previewPanel;
202: private javax.swing.JLabel previewText;
203: // End of variables declaration//GEN-END:variables
204:
205: }
|