1 19 package org.netbeans.modules.versioning.system.cvss.options; 20 21 import org.netbeans.modules.versioning.util.StringSelector; 22 import org.openide.util.NbBundle; 23 24 import javax.swing.*; 25 import java.util.*; 26 27 32 class CvsOptionsPanel extends javax.swing.JPanel { 33 34 35 public CvsOptionsPanel() { 36 initComponents(); 37 refreshComponents(); 38 } 39 40 private void refreshComponents() { 41 wrapCharCount.setEnabled(wrapCommitMessages.isSelected()); 42 } 43 44 public JCheckBox getExcludeNewFiles() { 45 return excludeNewFiles; 46 } 47 48 public JTextField getStatusLabelFormat() { 49 return statusLabelFormat; 50 } 51 52 public JButton getStatusVarsBrowse() { 53 return statusVarsBrowse; 54 } 55 56 public JTextField getWrapCharCount() { 57 return wrapCharCount; 58 } 59 60 public JCheckBox getWrapCommitMessages() { 61 return wrapCommitMessages; 62 } 63 64 69 private void initComponents() { 71 72 jLabel1 = new javax.swing.JLabel (); 73 statusLabelFormat = new javax.swing.JTextField (); 74 excludeNewFiles = new javax.swing.JCheckBox (); 75 statusVarsBrowse = new javax.swing.JButton (); 76 wrapCommitMessages = new javax.swing.JCheckBox (); 77 wrapCharCount = new javax.swing.JTextField (); 78 79 jLabel1.setLabelFor(statusLabelFormat); 80 org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(CvsOptionsPanel.class, "CvsOptionsPanel.jLabel1.text")); 82 statusLabelFormat.setText(org.openide.util.NbBundle.getMessage(CvsOptionsPanel.class, "CvsOptionsPanel.statusLabelFormat.text")); 84 excludeNewFiles.setBackground(new java.awt.Color (255, 255, 255)); 85 org.openide.awt.Mnemonics.setLocalizedText(excludeNewFiles, org.openide.util.NbBundle.getMessage(CvsOptionsPanel.class, "CvsOptionsPanel.excludeNewFiles.text")); excludeNewFiles.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 87 excludeNewFiles.setMargin(new java.awt.Insets (0, 0, 0, 0)); 88 excludeNewFiles.addActionListener(new java.awt.event.ActionListener () { 89 public void actionPerformed(java.awt.event.ActionEvent evt) { 90 excludeNewFilesActionPerformed(evt); 91 } 92 }); 93 94 org.openide.awt.Mnemonics.setLocalizedText(statusVarsBrowse, org.openide.util.NbBundle.getMessage(CvsOptionsPanel.class, "CvsOptionsPanel.statusVarsBrowse.text")); statusVarsBrowse.addActionListener(new java.awt.event.ActionListener () { 96 public void actionPerformed(java.awt.event.ActionEvent evt) { 97 statusVarsBrowseActionPerformed(evt); 98 } 99 }); 100 101 wrapCommitMessages.setBackground(new java.awt.Color (255, 255, 255)); 102 org.openide.awt.Mnemonics.setLocalizedText(wrapCommitMessages, org.openide.util.NbBundle.getMessage(CvsOptionsPanel.class, "CvsOptionsPanel.wrapCommitMessages.text")); wrapCommitMessages.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); 104 wrapCommitMessages.setMargin(new java.awt.Insets (0, 0, 0, 0)); 105 wrapCommitMessages.addActionListener(new java.awt.event.ActionListener () { 106 public void actionPerformed(java.awt.event.ActionEvent evt) { 107 wrapCommitMessagesActionPerformed(evt); 108 } 109 }); 110 111 wrapCharCount.setColumns(4); 112 wrapCharCount.setText(org.openide.util.NbBundle.getMessage(CvsOptionsPanel.class, "CvsOptionsPanel.wrapCharCount.text")); 114 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); 115 this.setLayout(layout); 116 layout.setHorizontalGroup( 117 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 118 .add(layout.createSequentialGroup() 119 .addContainerGap() 120 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 121 .add(layout.createSequentialGroup() 122 .add(jLabel1) 123 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 124 .add(statusLabelFormat, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 256, Short.MAX_VALUE) 125 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 126 .add(statusVarsBrowse)) 127 .add(layout.createSequentialGroup() 128 .add(wrapCommitMessages) 129 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 130 .add(wrapCharCount, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 55, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 131 .add(excludeNewFiles))) 132 ); 133 layout.setVerticalGroup( 134 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 135 .add(layout.createSequentialGroup() 136 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 137 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 138 .add(jLabel1) 139 .add(statusVarsBrowse) 140 .add(statusLabelFormat, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 141 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 142 .add(excludeNewFiles) 143 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 144 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 145 .add(wrapCommitMessages) 146 .add(wrapCharCount, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))) 147 ); 148 } 150 private void wrapCommitMessagesActionPerformed(java.awt.event.ActionEvent evt) { refreshComponents(); 152 } 154 private void statusVarsBrowseActionPerformed(java.awt.event.ActionEvent evt) { List<String > formatVars = new ArrayList<String >(); 156 formatVars.add(NbBundle.getMessage(CvsOptionsPanel.class, "LBL_FormatVariable_1")); 157 formatVars.add(NbBundle.getMessage(CvsOptionsPanel.class, "LBL_FormatVariable_2")); 158 formatVars.add(NbBundle.getMessage(CvsOptionsPanel.class, "LBL_FormatVariable_3")); 159 formatVars.add(NbBundle.getMessage(CvsOptionsPanel.class, "LBL_FormatVariable_4")); 160 String newVariable = StringSelector.select(NbBundle.getMessage(CvsOptionsPanel.class, "LBL_FormatVariable_Title"), 161 NbBundle.getMessage(CvsOptionsPanel.class, "LBL_FormatVariable_Prompt"), 162 formatVars); 163 if (newVariable != null) { 164 statusLabelFormat.replaceSelection(newVariable.substring(0, newVariable.lastIndexOf('}') + 1)); 165 } 166 } 168 private void excludeNewFilesActionPerformed(java.awt.event.ActionEvent evt) { } 172 173 private javax.swing.JCheckBox excludeNewFiles; 175 private javax.swing.JLabel jLabel1; 176 private javax.swing.JTextField statusLabelFormat; 177 private javax.swing.JButton statusVarsBrowse; 178 private javax.swing.JTextField wrapCharCount; 179 private javax.swing.JCheckBox wrapCommitMessages; 180 182 } 183 | Popular Tags |