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.java.ui;
043:
044: import javax.swing.UIManager;
045: import org.netbeans.api.java.source.CodeStyle.WrapStyle;
046: import static org.netbeans.modules.java.ui.FmtOptions.*;
047: import static org.netbeans.modules.java.ui.FmtOptions.CategorySupport.OPTION_ID;
048: import org.netbeans.modules.java.ui.FmtOptions.CategorySupport;
049: import org.openide.util.NbBundle;
050:
051: /**
052: *
053: * @author phrebejk
054: */
055: public class FmtAlignmentBraces extends javax.swing.JPanel {
056:
057: /** Creates new form FmtAlignmentBraces */
058: public FmtAlignmentBraces() {
059: initComponents();
060: if ("Windows".equals(UIManager.getLookAndFeel().getID())) {//NOI18N
061: newLinesPanel.setOpaque(false);
062: bracesGenerationPanel.setOpaque(false);
063: bracesPlacementPanel.setOpaque(false);
064: multilineAlignmentPanel.setOpaque(false);
065: }
066: classDeclCombo.putClientProperty(OPTION_ID,
067: classDeclBracePlacement);
068: methodDeclCombo.putClientProperty(OPTION_ID,
069: methodDeclBracePlacement);
070: otherCombo.putClientProperty(OPTION_ID, otherBracePlacement);
071: specialElseIfCheckBox.putClientProperty(OPTION_ID,
072: specialElseIf);
073: ifBracesCombo.putClientProperty(OPTION_ID, redundantIfBraces);
074: forBracesCombo.putClientProperty(OPTION_ID, redundantForBraces);
075: whileBracesCombo.putClientProperty(OPTION_ID,
076: redundantWhileBraces);
077: doWhileBracesCombo.putClientProperty(OPTION_ID,
078: redundantDoWhileBraces);
079: nlElseCheckBox.putClientProperty(OPTION_ID, placeElseOnNewLine);
080: nlWhileCheckBox.putClientProperty(OPTION_ID,
081: placeWhileOnNewLine);
082: nlCatchCheckBox.putClientProperty(OPTION_ID,
083: placeCatchOnNewLine);
084: nlFinallyCheckBox.putClientProperty(OPTION_ID,
085: placeFinallyOnNewLine);
086: nlModifiersCheckBox.putClientProperty(OPTION_ID,
087: placeNewLineAfterModifiers);
088: amMethodParamsCheckBox.putClientProperty(OPTION_ID,
089: alignMultilineMethodParams);
090: amCallArgsCheckBox.putClientProperty(OPTION_ID,
091: alignMultilineCallArgs);
092: amAnnotationArgsCheckBox.putClientProperty(OPTION_ID,
093: alignMultilineAnnotationArgs);
094: amImplementsCheckBox.putClientProperty(OPTION_ID,
095: alignMultilineImplements);
096: amThrowsCheckBox.putClientProperty(OPTION_ID,
097: alignMultilineThrows);
098: amParenthesizedCheckBox.putClientProperty(OPTION_ID,
099: alignMultilineParenthesized);
100: amBinaryOpCheckBox.putClientProperty(OPTION_ID,
101: alignMultilineBinaryOp);
102: amTernaryOpCheckBox.putClientProperty(OPTION_ID,
103: alignMultilineTernaryOp);
104: amAssignCheckBox.putClientProperty(OPTION_ID,
105: alignMultilineAssignment);
106: amForCheckBox.putClientProperty(OPTION_ID, alignMultilineFor);
107: amArrayInitCheckBox.putClientProperty(OPTION_ID,
108: alignMultilineArrayInit);
109: }
110:
111: public static FormatingOptionsPanel.Category getController() {
112: return new CategorySupport("LBL_AlignmentAndBraces", // NOI18N
113: new FmtAlignmentBraces(), // NOI18N
114: NbBundle.getMessage(FmtAlignmentBraces.class,
115: "SAMPLE_AlignBraces"), new String[] {
116: FmtOptions.wrapAnnotations,
117: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
118: FmtOptions.wrapArrayInit,
119: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
120: FmtOptions.wrapAssert,
121: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
122: FmtOptions.wrapAssignOps,
123: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
124: FmtOptions.wrapBinaryOps,
125: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
126: FmtOptions.wrapChainedMethodCalls,
127: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
128: FmtOptions.wrapDoWhileStatement,
129: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
130: FmtOptions.wrapEnumConstants,
131: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
132: FmtOptions.wrapExtendsImplementsKeyword,
133: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
134: FmtOptions.wrapExtendsImplementsList,
135: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
136: FmtOptions.wrapFor,
137: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
138: FmtOptions.wrapForStatement,
139: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
140: FmtOptions.wrapIfStatement,
141: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
142: FmtOptions.wrapMethodCallArgs,
143: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
144: FmtOptions.wrapAnnotationArgs,
145: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
146: FmtOptions.wrapMethodParams,
147: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
148: FmtOptions.wrapTernaryOps,
149: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
150: FmtOptions.wrapThrowsKeyword,
151: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
152: FmtOptions.wrapThrowsList,
153: WrapStyle.WRAP_ALWAYS.name() }, new String[] {
154: FmtOptions.wrapWhileStatement,
155: WrapStyle.WRAP_ALWAYS.name() });
156: }
157:
158: /** This method is called from within the constructor to
159: * initialize the form.
160: * WARNING: Do NOT modify this code. The content of this method is
161: * always regenerated by the Form Editor.
162: */
163: // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
164: private void initComponents() {
165: java.awt.GridBagConstraints gridBagConstraints;
166:
167: jTabbedPane1 = new javax.swing.JTabbedPane();
168: bracesPlacementPanel = new javax.swing.JPanel();
169: classDeclLabel = new javax.swing.JLabel();
170: classDeclCombo = new javax.swing.JComboBox();
171: methodDeclLabel = new javax.swing.JLabel();
172: methodDeclCombo = new javax.swing.JComboBox();
173: otherLabel = new javax.swing.JLabel();
174: otherCombo = new javax.swing.JComboBox();
175: specialElseIfCheckBox = new javax.swing.JCheckBox();
176: multilineAlignmentPanel = new javax.swing.JPanel();
177: amMethodParamsCheckBox = new javax.swing.JCheckBox();
178: amCallArgsCheckBox = new javax.swing.JCheckBox();
179: amAnnotationArgsCheckBox = new javax.swing.JCheckBox();
180: amImplementsCheckBox = new javax.swing.JCheckBox();
181: amThrowsCheckBox = new javax.swing.JCheckBox();
182: amArrayInitCheckBox = new javax.swing.JCheckBox();
183: amBinaryOpCheckBox = new javax.swing.JCheckBox();
184: amTernaryOpCheckBox = new javax.swing.JCheckBox();
185: amAssignCheckBox = new javax.swing.JCheckBox();
186: amForCheckBox = new javax.swing.JCheckBox();
187: amParenthesizedCheckBox = new javax.swing.JCheckBox();
188: bracesGenerationPanel = new javax.swing.JPanel();
189: ifBracesLabel = new javax.swing.JLabel();
190: ifBracesCombo = new javax.swing.JComboBox();
191: forBracesLabel = new javax.swing.JLabel();
192: forBracesCombo = new javax.swing.JComboBox();
193: whileBracesLabel = new javax.swing.JLabel();
194: whileBracesCombo = new javax.swing.JComboBox();
195: doWhileBracesLabel = new javax.swing.JLabel();
196: doWhileBracesCombo = new javax.swing.JComboBox();
197: jPanel1 = new javax.swing.JPanel();
198: newLinesPanel = new javax.swing.JPanel();
199: nlElseCheckBox = new javax.swing.JCheckBox();
200: nlWhileCheckBox = new javax.swing.JCheckBox();
201: nlCatchCheckBox = new javax.swing.JCheckBox();
202: nlFinallyCheckBox = new javax.swing.JCheckBox();
203: nlModifiersCheckBox = new javax.swing.JCheckBox();
204: jLabel1 = new javax.swing.JLabel();
205:
206: setOpaque(false);
207: setLayout(new java.awt.BorderLayout());
208:
209: bracesPlacementPanel.setBorder(javax.swing.BorderFactory
210: .createEmptyBorder(8, 8, 8, 8));
211: bracesPlacementPanel.setLayout(new java.awt.GridBagLayout());
212:
213: classDeclLabel.setLabelFor(classDeclCombo);
214: org.openide.awt.Mnemonics.setLocalizedText(classDeclLabel,
215: org.openide.util.NbBundle.getMessage(
216: FmtAlignmentBraces.class, "LBL_bp_ClassDecl")); // NOI18N
217: gridBagConstraints = new java.awt.GridBagConstraints();
218: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
219: gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
220: bracesPlacementPanel.add(classDeclLabel, gridBagConstraints);
221:
222: classDeclCombo
223: .setModel(new javax.swing.DefaultComboBoxModel(
224: new String[] { "Item 1", "Item 2", "Item 3",
225: "Item 4" }));
226: gridBagConstraints = new java.awt.GridBagConstraints();
227: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
228: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
229: gridBagConstraints.weightx = 1.0;
230: gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0);
231: bracesPlacementPanel.add(classDeclCombo, gridBagConstraints);
232:
233: methodDeclLabel.setLabelFor(methodDeclCombo);
234: org.openide.awt.Mnemonics.setLocalizedText(methodDeclLabel,
235: org.openide.util.NbBundle.getMessage(
236: FmtAlignmentBraces.class, "LBL_bp_MethodDecl")); // NOI18N
237: gridBagConstraints = new java.awt.GridBagConstraints();
238: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
239: gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
240: bracesPlacementPanel.add(methodDeclLabel, gridBagConstraints);
241:
242: methodDeclCombo
243: .setModel(new javax.swing.DefaultComboBoxModel(
244: new String[] { "Item 1", "Item 2", "Item 3",
245: "Item 4" }));
246: methodDeclCombo
247: .addActionListener(new java.awt.event.ActionListener() {
248: public void actionPerformed(
249: java.awt.event.ActionEvent evt) {
250: methodDeclComboActionPerformed(evt);
251: }
252: });
253: gridBagConstraints = new java.awt.GridBagConstraints();
254: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
255: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
256: gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0);
257: bracesPlacementPanel.add(methodDeclCombo, gridBagConstraints);
258:
259: otherLabel.setLabelFor(otherCombo);
260: org.openide.awt.Mnemonics.setLocalizedText(otherLabel,
261: org.openide.util.NbBundle.getMessage(
262: FmtAlignmentBraces.class, "LBL_bp_Other")); // NOI18N
263: gridBagConstraints = new java.awt.GridBagConstraints();
264: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
265: gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
266: bracesPlacementPanel.add(otherLabel, gridBagConstraints);
267:
268: otherCombo
269: .setModel(new javax.swing.DefaultComboBoxModel(
270: new String[] { "Item 1", "Item 2", "Item 3",
271: "Item 4" }));
272: gridBagConstraints = new java.awt.GridBagConstraints();
273: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
274: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
275: gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0);
276: bracesPlacementPanel.add(otherCombo, gridBagConstraints);
277:
278: org.openide.awt.Mnemonics.setLocalizedText(
279: specialElseIfCheckBox, org.openide.util.NbBundle
280: .getMessage(FmtAlignmentBraces.class,
281: "LBL_bp_SpecialElseIf")); // NOI18N
282: specialElseIfCheckBox.setBorder(javax.swing.BorderFactory
283: .createEmptyBorder(0, 0, 0, 0));
284: specialElseIfCheckBox
285: .setMargin(new java.awt.Insets(0, 0, 0, 0));
286: specialElseIfCheckBox.setOpaque(false);
287: gridBagConstraints = new java.awt.GridBagConstraints();
288: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
289: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
290: gridBagConstraints.weighty = 1.0;
291: bracesPlacementPanel.add(specialElseIfCheckBox,
292: gridBagConstraints);
293:
294: jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(
295: FmtAlignmentBraces.class, "LBL_ab_placementBorder"),
296: bracesPlacementPanel); // NOI18N
297:
298: multilineAlignmentPanel.setBorder(javax.swing.BorderFactory
299: .createEmptyBorder(8, 8, 8, 8));
300: multilineAlignmentPanel.setLayout(new java.awt.GridBagLayout());
301:
302: org.openide.awt.Mnemonics.setLocalizedText(
303: amMethodParamsCheckBox, org.openide.util.NbBundle
304: .getMessage(FmtAlignmentBraces.class,
305: "LBL_am_MethodParams")); // NOI18N
306: amMethodParamsCheckBox.setBorder(javax.swing.BorderFactory
307: .createEmptyBorder(0, 0, 0, 0));
308: amMethodParamsCheckBox
309: .setMargin(new java.awt.Insets(0, 0, 0, 0));
310: amMethodParamsCheckBox.setOpaque(false);
311: gridBagConstraints = new java.awt.GridBagConstraints();
312: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
313: gridBagConstraints.weightx = 1.0;
314: gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
315: multilineAlignmentPanel.add(amMethodParamsCheckBox,
316: gridBagConstraints);
317:
318: org.openide.awt.Mnemonics.setLocalizedText(amCallArgsCheckBox,
319: org.openide.util.NbBundle.getMessage(
320: FmtAlignmentBraces.class, "LBL_am_CallArgs")); // NOI18N
321: amCallArgsCheckBox.setBorder(javax.swing.BorderFactory
322: .createEmptyBorder(0, 0, 0, 0));
323: amCallArgsCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
324: amCallArgsCheckBox.setOpaque(false);
325: gridBagConstraints = new java.awt.GridBagConstraints();
326: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
327: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
328: gridBagConstraints.insets = new java.awt.Insets(0, 8, 6, 0);
329: multilineAlignmentPanel.add(amCallArgsCheckBox,
330: gridBagConstraints);
331:
332: org.openide.awt.Mnemonics.setLocalizedText(
333: amAnnotationArgsCheckBox, org.openide.util.NbBundle
334: .getMessage(FmtAlignmentBraces.class,
335: "LBL_am_AnnotationArgs")); // NOI18N
336: amAnnotationArgsCheckBox.setBorder(javax.swing.BorderFactory
337: .createEmptyBorder(0, 0, 0, 0));
338: amAnnotationArgsCheckBox.setMargin(new java.awt.Insets(0, 0, 0,
339: 0));
340: amAnnotationArgsCheckBox.setOpaque(false);
341: gridBagConstraints = new java.awt.GridBagConstraints();
342: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
343: gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
344: multilineAlignmentPanel.add(amAnnotationArgsCheckBox,
345: gridBagConstraints);
346:
347: org.openide.awt.Mnemonics.setLocalizedText(
348: amImplementsCheckBox, org.openide.util.NbBundle
349: .getMessage(FmtAlignmentBraces.class,
350: "LBL_an_Implements")); // NOI18N
351: amImplementsCheckBox.setBorder(javax.swing.BorderFactory
352: .createEmptyBorder(0, 0, 0, 0));
353: amImplementsCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
354: amImplementsCheckBox.setOpaque(false);
355: gridBagConstraints = new java.awt.GridBagConstraints();
356: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
357: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
358: gridBagConstraints.insets = new java.awt.Insets(0, 8, 6, 0);
359: multilineAlignmentPanel.add(amImplementsCheckBox,
360: gridBagConstraints);
361:
362: org.openide.awt.Mnemonics.setLocalizedText(amThrowsCheckBox,
363: org.openide.util.NbBundle.getMessage(
364: FmtAlignmentBraces.class, "LBL_am_Throws")); // NOI18N
365: amThrowsCheckBox.setBorder(javax.swing.BorderFactory
366: .createEmptyBorder(0, 0, 0, 0));
367: amThrowsCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
368: amThrowsCheckBox.setOpaque(false);
369: gridBagConstraints = new java.awt.GridBagConstraints();
370: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
371: gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
372: multilineAlignmentPanel.add(amThrowsCheckBox,
373: gridBagConstraints);
374:
375: org.openide.awt.Mnemonics.setLocalizedText(amArrayInitCheckBox,
376: org.openide.util.NbBundle.getMessage(
377: FmtAlignmentBraces.class, "LBL_am_ArrayInit")); // NOI18N
378: amArrayInitCheckBox.setBorder(javax.swing.BorderFactory
379: .createEmptyBorder(0, 0, 0, 0));
380: amArrayInitCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
381: amArrayInitCheckBox.setOpaque(false);
382: gridBagConstraints = new java.awt.GridBagConstraints();
383: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
384: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
385: gridBagConstraints.insets = new java.awt.Insets(0, 8, 6, 0);
386: multilineAlignmentPanel.add(amArrayInitCheckBox,
387: gridBagConstraints);
388:
389: org.openide.awt.Mnemonics.setLocalizedText(amBinaryOpCheckBox,
390: org.openide.util.NbBundle.getMessage(
391: FmtAlignmentBraces.class, "LBL_am_BinaryOp")); // NOI18N
392: amBinaryOpCheckBox.setBorder(javax.swing.BorderFactory
393: .createEmptyBorder(0, 0, 0, 0));
394: amBinaryOpCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
395: amBinaryOpCheckBox.setOpaque(false);
396: gridBagConstraints = new java.awt.GridBagConstraints();
397: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
398: gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
399: multilineAlignmentPanel.add(amBinaryOpCheckBox,
400: gridBagConstraints);
401:
402: org.openide.awt.Mnemonics.setLocalizedText(amTernaryOpCheckBox,
403: org.openide.util.NbBundle.getMessage(
404: FmtAlignmentBraces.class, "LBL_am_TernaryOp")); // NOI18N
405: amTernaryOpCheckBox.setBorder(javax.swing.BorderFactory
406: .createEmptyBorder(0, 0, 0, 0));
407: amTernaryOpCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
408: amTernaryOpCheckBox.setOpaque(false);
409: gridBagConstraints = new java.awt.GridBagConstraints();
410: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
411: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
412: gridBagConstraints.insets = new java.awt.Insets(0, 8, 6, 8);
413: multilineAlignmentPanel.add(amTernaryOpCheckBox,
414: gridBagConstraints);
415:
416: org.openide.awt.Mnemonics.setLocalizedText(amAssignCheckBox,
417: org.openide.util.NbBundle.getMessage(
418: FmtAlignmentBraces.class, "LBL_am_Assign")); // NOI18N
419: amAssignCheckBox.setBorder(javax.swing.BorderFactory
420: .createEmptyBorder(0, 0, 0, 0));
421: amAssignCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
422: amAssignCheckBox.setOpaque(false);
423: gridBagConstraints = new java.awt.GridBagConstraints();
424: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
425: gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
426: multilineAlignmentPanel.add(amAssignCheckBox,
427: gridBagConstraints);
428:
429: org.openide.awt.Mnemonics.setLocalizedText(amForCheckBox,
430: org.openide.util.NbBundle.getMessage(
431: FmtAlignmentBraces.class, "LBL_am_For")); // NOI18N
432: amForCheckBox.setBorder(javax.swing.BorderFactory
433: .createEmptyBorder(0, 0, 0, 0));
434: amForCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
435: amForCheckBox.setOpaque(false);
436: gridBagConstraints = new java.awt.GridBagConstraints();
437: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
438: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
439: gridBagConstraints.insets = new java.awt.Insets(0, 8, 6, 0);
440: multilineAlignmentPanel.add(amForCheckBox, gridBagConstraints);
441:
442: org.openide.awt.Mnemonics.setLocalizedText(
443: amParenthesizedCheckBox, org.openide.util.NbBundle
444: .getMessage(FmtAlignmentBraces.class,
445: "LBL_am_Paren")); // NOI18N
446: amParenthesizedCheckBox.setBorder(javax.swing.BorderFactory
447: .createEmptyBorder(0, 0, 0, 0));
448: amParenthesizedCheckBox.setMargin(new java.awt.Insets(0, 0, 0,
449: 0));
450: amParenthesizedCheckBox.setOpaque(false);
451: gridBagConstraints = new java.awt.GridBagConstraints();
452: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
453: gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
454: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
455: gridBagConstraints.weighty = 1.0;
456: multilineAlignmentPanel.add(amParenthesizedCheckBox,
457: gridBagConstraints);
458:
459: jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(
460: FmtAlignmentBraces.class,
461: "LBL_ab_multilineAlignmentBodrer"),
462: multilineAlignmentPanel); // NOI18N
463:
464: bracesGenerationPanel.setBorder(javax.swing.BorderFactory
465: .createEmptyBorder(8, 8, 8, 8));
466: bracesGenerationPanel.setLayout(new java.awt.GridBagLayout());
467:
468: ifBracesLabel.setLabelFor(ifBracesCombo);
469: org.openide.awt.Mnemonics.setLocalizedText(ifBracesLabel,
470: org.openide.util.NbBundle.getMessage(
471: FmtAlignmentBraces.class, "LBL_bg_If")); // NOI18N
472: gridBagConstraints = new java.awt.GridBagConstraints();
473: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
474: gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
475: bracesGenerationPanel.add(ifBracesLabel, gridBagConstraints);
476:
477: ifBracesCombo
478: .setModel(new javax.swing.DefaultComboBoxModel(
479: new String[] { "Item 1", "Item 2", "Item 3",
480: "Item 4" }));
481: gridBagConstraints = new java.awt.GridBagConstraints();
482: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
483: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
484: gridBagConstraints.weightx = 1.0;
485: gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0);
486: bracesGenerationPanel.add(ifBracesCombo, gridBagConstraints);
487:
488: forBracesLabel.setLabelFor(forBracesCombo);
489: org.openide.awt.Mnemonics.setLocalizedText(forBracesLabel,
490: org.openide.util.NbBundle.getMessage(
491: FmtAlignmentBraces.class, "LBL_bg_For")); // NOI18N
492: gridBagConstraints = new java.awt.GridBagConstraints();
493: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
494: gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
495: bracesGenerationPanel.add(forBracesLabel, gridBagConstraints);
496:
497: forBracesCombo
498: .setModel(new javax.swing.DefaultComboBoxModel(
499: new String[] { "Item 1", "Item 2", "Item 3",
500: "Item 4" }));
501: gridBagConstraints = new java.awt.GridBagConstraints();
502: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
503: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
504: gridBagConstraints.weightx = 1.0;
505: gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0);
506: bracesGenerationPanel.add(forBracesCombo, gridBagConstraints);
507:
508: whileBracesLabel.setLabelFor(whileBracesCombo);
509: org.openide.awt.Mnemonics.setLocalizedText(whileBracesLabel,
510: org.openide.util.NbBundle.getMessage(
511: FmtAlignmentBraces.class, "LBL_bg_While")); // NOI18N
512: gridBagConstraints = new java.awt.GridBagConstraints();
513: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
514: gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
515: bracesGenerationPanel.add(whileBracesLabel, gridBagConstraints);
516:
517: whileBracesCombo
518: .setModel(new javax.swing.DefaultComboBoxModel(
519: new String[] { "Item 1", "Item 2", "Item 3",
520: "Item 4" }));
521: gridBagConstraints = new java.awt.GridBagConstraints();
522: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
523: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
524: gridBagConstraints.weightx = 1.0;
525: gridBagConstraints.insets = new java.awt.Insets(0, 6, 4, 0);
526: bracesGenerationPanel.add(whileBracesCombo, gridBagConstraints);
527:
528: doWhileBracesLabel.setLabelFor(doWhileBracesCombo);
529: org.openide.awt.Mnemonics.setLocalizedText(doWhileBracesLabel,
530: org.openide.util.NbBundle.getMessage(
531: FmtAlignmentBraces.class, "LBL_bg_DoWhile")); // NOI18N
532: gridBagConstraints = new java.awt.GridBagConstraints();
533: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
534: bracesGenerationPanel.add(doWhileBracesLabel,
535: gridBagConstraints);
536:
537: doWhileBracesCombo
538: .setModel(new javax.swing.DefaultComboBoxModel(
539: new String[] { "Item 1", "Item 2", "Item 3",
540: "Item 4" }));
541: gridBagConstraints = new java.awt.GridBagConstraints();
542: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
543: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
544: gridBagConstraints.weightx = 1.0;
545: gridBagConstraints.insets = new java.awt.Insets(0, 6, 0, 0);
546: bracesGenerationPanel.add(doWhileBracesCombo,
547: gridBagConstraints);
548:
549: org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(
550: jPanel1);
551: jPanel1.setLayout(jPanel1Layout);
552: jPanel1Layout.setHorizontalGroup(jPanel1Layout
553: .createParallelGroup(
554: org.jdesktop.layout.GroupLayout.LEADING).add(0,
555: 0, Short.MAX_VALUE));
556: jPanel1Layout.setVerticalGroup(jPanel1Layout
557: .createParallelGroup(
558: org.jdesktop.layout.GroupLayout.LEADING).add(0,
559: 0, Short.MAX_VALUE));
560:
561: gridBagConstraints = new java.awt.GridBagConstraints();
562: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
563: gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
564: gridBagConstraints.weighty = 1.0;
565: bracesGenerationPanel.add(jPanel1, gridBagConstraints);
566:
567: jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(
568: FmtAlignmentBraces.class, "LBL_ab_generationBorder"),
569: bracesGenerationPanel); // NOI18N
570:
571: newLinesPanel.setBorder(javax.swing.BorderFactory
572: .createEmptyBorder(8, 8, 8, 8));
573: newLinesPanel.setLayout(new java.awt.GridBagLayout());
574:
575: org.openide.awt.Mnemonics.setLocalizedText(nlElseCheckBox,
576: org.openide.util.NbBundle.getMessage(
577: FmtAlignmentBraces.class, "LBL_nl_Else")); // NOI18N
578: nlElseCheckBox.setBorder(javax.swing.BorderFactory
579: .createEmptyBorder(0, 0, 0, 0));
580: nlElseCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
581: nlElseCheckBox.setOpaque(false);
582: gridBagConstraints = new java.awt.GridBagConstraints();
583: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
584: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
585: gridBagConstraints.weightx = 1.0;
586: gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
587: newLinesPanel.add(nlElseCheckBox, gridBagConstraints);
588:
589: org.openide.awt.Mnemonics.setLocalizedText(nlWhileCheckBox,
590: org.openide.util.NbBundle.getMessage(
591: FmtAlignmentBraces.class, "LBL_nl_While")); // NOI18N
592: nlWhileCheckBox.setBorder(javax.swing.BorderFactory
593: .createEmptyBorder(0, 0, 0, 0));
594: nlWhileCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
595: nlWhileCheckBox.setOpaque(false);
596: gridBagConstraints = new java.awt.GridBagConstraints();
597: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
598: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
599: gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
600: newLinesPanel.add(nlWhileCheckBox, gridBagConstraints);
601:
602: org.openide.awt.Mnemonics.setLocalizedText(nlCatchCheckBox,
603: org.openide.util.NbBundle.getMessage(
604: FmtAlignmentBraces.class, "LBL_nl_Catch")); // NOI18N
605: nlCatchCheckBox.setBorder(javax.swing.BorderFactory
606: .createEmptyBorder(0, 0, 0, 0));
607: nlCatchCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
608: nlCatchCheckBox.setOpaque(false);
609: gridBagConstraints = new java.awt.GridBagConstraints();
610: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
611: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
612: gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
613: newLinesPanel.add(nlCatchCheckBox, gridBagConstraints);
614:
615: org.openide.awt.Mnemonics.setLocalizedText(nlFinallyCheckBox,
616: org.openide.util.NbBundle.getMessage(
617: FmtAlignmentBraces.class, "LBL_nl_Finally")); // NOI18N
618: nlFinallyCheckBox.setBorder(javax.swing.BorderFactory
619: .createEmptyBorder(0, 0, 0, 0));
620: nlFinallyCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
621: nlFinallyCheckBox.setOpaque(false);
622: gridBagConstraints = new java.awt.GridBagConstraints();
623: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
624: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
625: gridBagConstraints.insets = new java.awt.Insets(0, 0, 6, 0);
626: newLinesPanel.add(nlFinallyCheckBox, gridBagConstraints);
627:
628: org.openide.awt.Mnemonics.setLocalizedText(nlModifiersCheckBox,
629: org.openide.util.NbBundle.getMessage(
630: FmtAlignmentBraces.class, "LBL_nl_Modifiers")); // NOI18N
631: nlModifiersCheckBox.setBorder(javax.swing.BorderFactory
632: .createEmptyBorder(0, 0, 0, 0));
633: nlModifiersCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));
634: nlModifiersCheckBox.setOpaque(false);
635: gridBagConstraints = new java.awt.GridBagConstraints();
636: gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;
637: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
638: newLinesPanel.add(nlModifiersCheckBox, gridBagConstraints);
639: gridBagConstraints = new java.awt.GridBagConstraints();
640: gridBagConstraints.weighty = 1.0;
641: newLinesPanel.add(jLabel1, gridBagConstraints);
642:
643: jTabbedPane1.addTab(org.openide.util.NbBundle.getMessage(
644: FmtAlignmentBraces.class, "LBL_ab_newLinesBorder"),
645: newLinesPanel); // NOI18N
646:
647: add(jTabbedPane1, java.awt.BorderLayout.CENTER);
648: }// </editor-fold>//GEN-END:initComponents
649:
650: private void methodDeclComboActionPerformed(
651: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_methodDeclComboActionPerformed
652: // TODO add your handling code here:
653: }//GEN-LAST:event_methodDeclComboActionPerformed
654:
655: // Variables declaration - do not modify//GEN-BEGIN:variables
656: private javax.swing.JCheckBox amAnnotationArgsCheckBox;
657: private javax.swing.JCheckBox amArrayInitCheckBox;
658: private javax.swing.JCheckBox amAssignCheckBox;
659: private javax.swing.JCheckBox amBinaryOpCheckBox;
660: private javax.swing.JCheckBox amCallArgsCheckBox;
661: private javax.swing.JCheckBox amForCheckBox;
662: private javax.swing.JCheckBox amImplementsCheckBox;
663: private javax.swing.JCheckBox amMethodParamsCheckBox;
664: private javax.swing.JCheckBox amParenthesizedCheckBox;
665: private javax.swing.JCheckBox amTernaryOpCheckBox;
666: private javax.swing.JCheckBox amThrowsCheckBox;
667: private javax.swing.JPanel bracesGenerationPanel;
668: private javax.swing.JPanel bracesPlacementPanel;
669: private javax.swing.JComboBox classDeclCombo;
670: private javax.swing.JLabel classDeclLabel;
671: private javax.swing.JComboBox doWhileBracesCombo;
672: private javax.swing.JLabel doWhileBracesLabel;
673: private javax.swing.JComboBox forBracesCombo;
674: private javax.swing.JLabel forBracesLabel;
675: private javax.swing.JComboBox ifBracesCombo;
676: private javax.swing.JLabel ifBracesLabel;
677: private javax.swing.JLabel jLabel1;
678: private javax.swing.JPanel jPanel1;
679: private javax.swing.JTabbedPane jTabbedPane1;
680: private javax.swing.JComboBox methodDeclCombo;
681: private javax.swing.JLabel methodDeclLabel;
682: private javax.swing.JPanel multilineAlignmentPanel;
683: private javax.swing.JPanel newLinesPanel;
684: private javax.swing.JCheckBox nlCatchCheckBox;
685: private javax.swing.JCheckBox nlElseCheckBox;
686: private javax.swing.JCheckBox nlFinallyCheckBox;
687: private javax.swing.JCheckBox nlModifiersCheckBox;
688: private javax.swing.JCheckBox nlWhileCheckBox;
689: private javax.swing.JComboBox otherCombo;
690: private javax.swing.JLabel otherLabel;
691: private javax.swing.JCheckBox specialElseIfCheckBox;
692: private javax.swing.JComboBox whileBracesCombo;
693: private javax.swing.JLabel whileBracesLabel;
694: // End of variables declaration//GEN-END:variables
695:
696: }
|