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-2006 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: package org.netbeans.modules.ruby.options;
043:
044: import static org.netbeans.modules.ruby.options.FmtOptions.*;
045: import static org.netbeans.modules.ruby.options.FmtOptions.CategorySupport.OPTION_ID;
046: import org.netbeans.modules.ruby.options.FmtOptions.CategorySupport;
047: import org.openide.util.NbBundle;
048:
049: /**
050: *
051: * @author phrebejk
052: */
053: public class FmtTabsIndents extends javax.swing.JPanel {
054:
055: /** Creates new form FmtTabsIndents */
056: public FmtTabsIndents() {
057: initComponents();
058: // Not yet implemented
059: //indentCasesFromSwitchCheckBox.setVisible(false);
060:
061: indentSizeField.putClientProperty(OPTION_ID, indentSize);
062: continuationIndentSizeField.putClientProperty(OPTION_ID,
063: continuationIndentSize);
064: reformatCommentsCheckBox.putClientProperty(OPTION_ID,
065: reformatComments);
066: indentHtmlCheckBox.putClientProperty(OPTION_ID, indentHtml);
067: }
068:
069: public static FormatingOptionsPanel.Category getController() {
070: return new CategorySupport("LBL_Indents", new FmtTabsIndents(), // NOI18N
071: NbBundle.getMessage(FmtTabsIndents.class,
072: "SAMPLE_Indents"), // NOI18N
073: new String[] { FmtOptions.rightMargin, "30" }); // NOI18N
074: }
075:
076: /** This method is called from within the constructor to
077: * initialize the form.
078: * WARNING: Do NOT modify this code. The content of this method is
079: * always regenerated by the Form Editor.
080: */
081: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
082: private void initComponents() {
083:
084: jTextField3 = new javax.swing.JTextField();
085: jCheckBox3 = new javax.swing.JCheckBox();
086: indentSizeLabel = new javax.swing.JLabel();
087: indentSizeField = new javax.swing.JTextField();
088: continuationIndentSizeLabel = new javax.swing.JLabel();
089: continuationIndentSizeField = new javax.swing.JTextField();
090: reformatCommentsCheckBox = new javax.swing.JCheckBox();
091: indentHtmlCheckBox = new javax.swing.JCheckBox();
092:
093: jTextField3.setText("jTextField3");
094:
095: org.openide.awt.Mnemonics.setLocalizedText(jCheckBox3,
096: "jCheckBox3");
097: jCheckBox3.setBorder(javax.swing.BorderFactory
098: .createEmptyBorder(0, 0, 0, 0));
099: jCheckBox3.setMargin(new java.awt.Insets(0, 0, 0, 0));
100:
101: setOpaque(false);
102:
103: org.openide.awt.Mnemonics.setLocalizedText(indentSizeLabel,
104: org.openide.util.NbBundle.getMessage(
105: FmtTabsIndents.class, "LBL_IndentSize")); // NOI18N
106:
107: org.openide.awt.Mnemonics.setLocalizedText(
108: continuationIndentSizeLabel, org.openide.util.NbBundle
109: .getMessage(FmtTabsIndents.class,
110: "LBL_ContinuationIndentSize")); // NOI18N
111:
112: org.openide.awt.Mnemonics.setLocalizedText(
113: reformatCommentsCheckBox, org.openide.util.NbBundle
114: .getMessage(FmtTabsIndents.class,
115: "LBL_ReformatComments")); // NOI18N
116: reformatCommentsCheckBox.setMargin(new java.awt.Insets(0, 0, 0,
117: 0));
118:
119: org.openide.awt.Mnemonics.setLocalizedText(indentHtmlCheckBox,
120: org.openide.util.NbBundle.getMessage(
121: FmtTabsIndents.class, "LBL_IndentHTML")); // NOI18N
122:
123: org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
124: this );
125: this .setLayout(layout);
126: layout
127: .setHorizontalGroup(layout
128: .createParallelGroup(
129: org.jdesktop.layout.GroupLayout.LEADING)
130: .add(
131: layout
132: .createSequentialGroup()
133: .add(
134: layout
135: .createParallelGroup(
136: org.jdesktop.layout.GroupLayout.LEADING)
137: .add(
138: layout
139: .createSequentialGroup()
140: .add(
141: layout
142: .createParallelGroup(
143: org.jdesktop.layout.GroupLayout.LEADING)
144: .add(
145: indentSizeLabel)
146: .add(
147: continuationIndentSizeLabel))
148: .addPreferredGap(
149: org.jdesktop.layout.LayoutStyle.RELATED)
150: .add(
151: layout
152: .createParallelGroup(
153: org.jdesktop.layout.GroupLayout.LEADING,
154: false)
155: .add(
156: indentSizeField)
157: .add(
158: continuationIndentSizeField,
159: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
160: 75,
161: Short.MAX_VALUE)))
162: .add(
163: reformatCommentsCheckBox)
164: .add(
165: indentHtmlCheckBox))
166: .addContainerGap(
167: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
168: Short.MAX_VALUE)));
169: layout
170: .setVerticalGroup(layout
171: .createParallelGroup(
172: org.jdesktop.layout.GroupLayout.LEADING)
173: .add(
174: layout
175: .createSequentialGroup()
176: .add(
177: layout
178: .createParallelGroup(
179: org.jdesktop.layout.GroupLayout.BASELINE)
180: .add(
181: indentSizeLabel)
182: .add(
183: indentSizeField,
184: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
185: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
186: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
187: .add(14, 14, 14)
188: .add(
189: layout
190: .createParallelGroup(
191: org.jdesktop.layout.GroupLayout.BASELINE)
192: .add(
193: continuationIndentSizeLabel)
194: .add(
195: continuationIndentSizeField,
196: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
197: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
198: org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
199: .add(18, 18, 18)
200: .add(reformatCommentsCheckBox)
201: .addPreferredGap(
202: org.jdesktop.layout.LayoutStyle.UNRELATED)
203: .add(indentHtmlCheckBox)
204: .addContainerGap(
205: org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
206: Short.MAX_VALUE)));
207: }// </editor-fold>//GEN-END:initComponents
208:
209: // Variables declaration - do not modify//GEN-BEGIN:variables
210: private javax.swing.JTextField continuationIndentSizeField;
211: private javax.swing.JLabel continuationIndentSizeLabel;
212: private javax.swing.JCheckBox indentHtmlCheckBox;
213: private javax.swing.JTextField indentSizeField;
214: private javax.swing.JLabel indentSizeLabel;
215: private javax.swing.JCheckBox jCheckBox3;
216: private javax.swing.JTextField jTextField3;
217: private javax.swing.JCheckBox reformatCommentsCheckBox;
218: // End of variables declaration//GEN-END:variables
219:
220: }
|