1 19 20 package org.netbeans.modules.web.debug.breakpoints; 21 22 import org.netbeans.api.debugger.jpda.JPDABreakpoint; 23 import org.openide.util.NbBundle; 24 25 28 public class ActionsPanel extends javax.swing.JPanel { 29 30 private JspLineBreakpoint breakpoint; 31 32 33 public ActionsPanel (JspLineBreakpoint b) { 34 breakpoint = b; 35 initComponents (); 36 37 cbSuspend.addItem(NbBundle.getMessage(ActionsPanel.class, "LBL_CB_Actions_Panel_Suspend_None")); 38 cbSuspend.addItem(NbBundle.getMessage(ActionsPanel.class, "LBL_CB_Actions_Panel_Suspend_Current")); 39 cbSuspend.addItem(NbBundle.getMessage(ActionsPanel.class, "LBL_CB_Actions_Panel_Suspend_All")); 40 switch (b.getSuspend ()) { 41 case JspLineBreakpoint.SUSPEND_NONE: 42 cbSuspend.setSelectedIndex (0); 43 break; 44 case JspLineBreakpoint.SUSPEND_EVENT_THREAD: 45 cbSuspend.setSelectedIndex (1); 46 break; 47 case JspLineBreakpoint.SUSPEND_ALL: 48 cbSuspend.setSelectedIndex (2); 49 break; 50 } 51 if (b.getPrintText () != null) 52 tfPrintText.setText (b.getPrintText ()); 53 } 54 55 private void initComponents() 56 { 57 java.awt.GridBagConstraints gridBagConstraints; 58 59 tfPrintText = new javax.swing.JTextField (); 60 jLabel1 = new javax.swing.JLabel (); 61 cbSuspend = new javax.swing.JComboBox (); 62 jLabel2 = new javax.swing.JLabel (); 63 64 setLayout(new java.awt.GridBagLayout ()); 65 66 setBorder(new javax.swing.border.TitledBorder ("Actions")); 67 tfPrintText.setToolTipText(NbBundle.getMessage(ActionsPanel.class, "TTT_TF_Actions_Panel_Print_Text")); 68 tfPrintText.addActionListener(new java.awt.event.ActionListener () { 69 public void actionPerformed(java.awt.event.ActionEvent evt) { 70 } 72 }); 73 74 gridBagConstraints = new java.awt.GridBagConstraints (); 75 gridBagConstraints.gridx = 1; 76 gridBagConstraints.gridy = 1; 77 gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; 78 gridBagConstraints.insets = new java.awt.Insets (3, 3, 3, 3); 79 gridBagConstraints.weightx = 1.0; 80 add(tfPrintText, gridBagConstraints); 81 tfPrintText.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ActionsPanel.class, "ACSD_TF_Actions_Panel_Print_Text")); 82 83 jLabel1.setDisplayedMnemonic(NbBundle.getMessage(ActionsPanel.class, "MN_L_Actions_Panel_Suspend").charAt(0)); 84 jLabel1.setLabelFor(cbSuspend); 85 jLabel1.setText(NbBundle.getMessage(ActionsPanel.class, "L_Actions_Panel_Suspend")); 86 gridBagConstraints = new java.awt.GridBagConstraints (); 87 gridBagConstraints.gridx = 0; 88 gridBagConstraints.gridy = 0; 89 gridBagConstraints.insets = new java.awt.Insets (3, 3, 3, 3); 90 add(jLabel1, gridBagConstraints); 91 jLabel1.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ActionsPanel.class, "ASCD_L_Actions_Panel_Suspend")); 92 93 cbSuspend.setToolTipText(NbBundle.getMessage(ActionsPanel.class, "TTT_CB_Actions_Panel_Suspend")); 94 cbSuspend.addActionListener(new java.awt.event.ActionListener () { 95 public void actionPerformed(java.awt.event.ActionEvent evt) { 96 } 98 }); 99 100 gridBagConstraints = new java.awt.GridBagConstraints (); 101 gridBagConstraints.insets = new java.awt.Insets (3, 3, 3, 3); 102 gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; 103 add(cbSuspend, gridBagConstraints); 104 cbSuspend.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(ActionsPanel.class, "ASCD_CB_Actions_Panel_Suspend")); 105 106 jLabel2.setDisplayedMnemonic(NbBundle.getMessage(ActionsPanel.class, "MN_L_Actions_Panel_Print_Text").charAt(0)); 107 jLabel2.setLabelFor(tfPrintText); 108 jLabel2.setText(NbBundle.getMessage(ActionsPanel.class, "L_Actions_Panel_Print_Text")); 109 gridBagConstraints = new java.awt.GridBagConstraints (); 110 gridBagConstraints.gridx = 0; 111 gridBagConstraints.gridy = 1; 112 gridBagConstraints.insets = new java.awt.Insets (3, 3, 3, 3); 113 add(jLabel2, gridBagConstraints); 114 115 } 116 117 122 public void ok () { 123 String printText = tfPrintText.getText (); 124 if (printText.trim ().length () > 0) { 125 breakpoint.setPrintText (printText.trim ()); 126 } else { 127 breakpoint.setPrintText (null); 128 } 129 130 switch (cbSuspend.getSelectedIndex ()) { 131 case 0: 132 breakpoint.setSuspend (JspLineBreakpoint.SUSPEND_NONE); 133 break; 134 case 1: 135 breakpoint.setSuspend (JspLineBreakpoint.SUSPEND_EVENT_THREAD); 136 break; 137 case 2: 138 breakpoint.setSuspend (JspLineBreakpoint.SUSPEND_ALL); 139 break; 140 } 141 } 142 143 private javax.swing.JComboBox cbSuspend; 145 private javax.swing.JLabel jLabel1; 146 private javax.swing.JLabel jLabel2; 147 private javax.swing.JTextField tfPrintText; 148 150 } 151 | Popular Tags |