1 19 20 package org.netbeans.modules.debugger.jpda.ui.breakpoints; 21 22 import org.netbeans.api.debugger.jpda.JPDABreakpoint; 23 24 27 public class ActionsPanel extends javax.swing.JPanel { 28 29 private JPDABreakpoint breakpoint; 30 31 32 public ActionsPanel (JPDABreakpoint b) { 33 breakpoint = b; 34 initComponents (); 35 36 cbSuspend.addItem (java.util.ResourceBundle.getBundle("org/netbeans/modules/debugger/jpda/ui/breakpoints/Bundle").getString("LBL_CB_Actions_Panel_Suspend_None")); 37 cbSuspend.addItem (java.util.ResourceBundle.getBundle("org/netbeans/modules/debugger/jpda/ui/breakpoints/Bundle").getString("LBL_CB_Actions_Panel_Suspend_Current")); 38 cbSuspend.addItem (java.util.ResourceBundle.getBundle("org/netbeans/modules/debugger/jpda/ui/breakpoints/Bundle").getString("LBL_CB_Actions_Panel_Suspend_All")); 39 switch (b.getSuspend ()) { 40 case JPDABreakpoint.SUSPEND_NONE: 41 cbSuspend.setSelectedIndex (0); 42 break; 43 case JPDABreakpoint.SUSPEND_EVENT_THREAD: 44 cbSuspend.setSelectedIndex (1); 45 break; 46 case JPDABreakpoint.SUSPEND_ALL: 47 cbSuspend.setSelectedIndex (2); 48 break; 49 } 50 if (b.getPrintText () != null) 51 tfPrintText.setText (b.getPrintText ()); 52 } 53 54 59 private void initComponents() { 61 java.awt.GridBagConstraints gridBagConstraints; 62 63 tfPrintText = new javax.swing.JTextField (); 64 jLabel1 = new javax.swing.JLabel (); 65 cbSuspend = new javax.swing.JComboBox (); 66 jLabel2 = new javax.swing.JLabel (); 67 68 setLayout(new java.awt.GridBagLayout ()); 69 70 java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/netbeans/modules/debugger/jpda/ui/breakpoints/Bundle"); setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("L_Actions_Panel_BorderTitle"))); tfPrintText.setToolTipText(bundle.getString("TTT_TF_Actions_Panel_Print_Text")); tfPrintText.addActionListener(new java.awt.event.ActionListener () { 74 public void actionPerformed(java.awt.event.ActionEvent evt) { 75 tfPrintTextActionPerformed(evt); 76 } 77 }); 78 79 gridBagConstraints = new java.awt.GridBagConstraints (); 80 gridBagConstraints.gridx = 1; 81 gridBagConstraints.gridy = 1; 82 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 83 gridBagConstraints.weightx = 1.0; 84 gridBagConstraints.insets = new java.awt.Insets (3, 3, 3, 3); 85 add(tfPrintText, gridBagConstraints); 86 tfPrintText.getAccessibleContext().setAccessibleDescription(bundle.getString("ACSD_TF_Actions_Panel_Print_Text")); 88 jLabel1.setLabelFor(cbSuspend); 89 org.openide.awt.Mnemonics.setLocalizedText(jLabel1, bundle.getString("L_Actions_Panel_Suspend")); gridBagConstraints = new java.awt.GridBagConstraints (); 91 gridBagConstraints.gridx = 0; 92 gridBagConstraints.gridy = 0; 93 gridBagConstraints.insets = new java.awt.Insets (3, 3, 3, 3); 94 add(jLabel1, gridBagConstraints); 95 jLabel1.getAccessibleContext().setAccessibleDescription(bundle.getString("ASCD_L_Actions_Panel_Suspend")); 97 cbSuspend.setToolTipText(bundle.getString("TTT_CB_Actions_Panel_Suspend")); cbSuspend.addActionListener(new java.awt.event.ActionListener () { 99 public void actionPerformed(java.awt.event.ActionEvent evt) { 100 cbSuspendActionPerformed(evt); 101 } 102 }); 103 104 gridBagConstraints = new java.awt.GridBagConstraints (); 105 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 106 gridBagConstraints.insets = new java.awt.Insets (3, 3, 3, 3); 107 add(cbSuspend, gridBagConstraints); 108 cbSuspend.getAccessibleContext().setAccessibleDescription(bundle.getString("ASCD_CB_Actions_Panel_Suspend")); 110 jLabel2.setLabelFor(tfPrintText); 111 org.openide.awt.Mnemonics.setLocalizedText(jLabel2, bundle.getString("L_Actions_Panel_Print_Text")); gridBagConstraints = new java.awt.GridBagConstraints (); 113 gridBagConstraints.gridx = 0; 114 gridBagConstraints.gridy = 1; 115 gridBagConstraints.insets = new java.awt.Insets (3, 3, 3, 3); 116 add(jLabel2, gridBagConstraints); 117 118 } 120 private void tfPrintTextActionPerformed(java.awt.event.ActionEvent evt) { } 125 private void cbSuspendActionPerformed(java.awt.event.ActionEvent evt) { } 130 133 public void ok () { 134 String printText = tfPrintText.getText (); 135 if (printText.trim ().length () > 0) 136 breakpoint.setPrintText (printText.trim ()); 137 else 138 breakpoint.setPrintText (null); 139 140 switch (cbSuspend.getSelectedIndex ()) { 141 case 0: 142 breakpoint.setSuspend (JPDABreakpoint.SUSPEND_NONE); 143 break; 144 case 1: 145 breakpoint.setSuspend (JPDABreakpoint.SUSPEND_EVENT_THREAD); 146 break; 147 case 2: 148 breakpoint.setSuspend (JPDABreakpoint.SUSPEND_ALL); 149 break; 150 } 151 } 152 153 154 private javax.swing.JComboBox cbSuspend; 156 private javax.swing.JLabel jLabel1; 157 private javax.swing.JLabel jLabel2; 158 private javax.swing.JTextField tfPrintText; 159 161 } 162 | Popular Tags |