1 19 20 package org.netbeans.upgrade; 21 22 import java.awt.Dialog ; 23 import java.util.ArrayList ; 24 import java.util.List ; 25 import java.util.ResourceBundle ; 26 import javax.swing.JPanel ; 27 import javax.swing.event.ChangeListener ; 28 import org.openide.util.NbBundle; 29 30 31 34 final class AutoUpgradePanel extends JPanel { 35 36 String source; 37 38 39 public AutoUpgradePanel (String directory) { 40 this.source = directory; 41 initComponents(); 42 initAccessibility(); 43 } 44 45 48 void removeChangeListener(ChangeListener l) { 49 changeListeners.remove(l); 50 } 51 52 56 void addChangeListener(ChangeListener l) { 57 if (!changeListeners.contains(l)) { 58 changeListeners.add(l); 59 } 60 } 61 62 private void initAccessibility() { 63 this.getAccessibleContext().setAccessibleDescription(bundle.getString("MSG_Confirmation")); } 65 66 67 72 private void initComponents() { 74 txtVersions = new javax.swing.JTextArea (); 75 76 setLayout(new java.awt.BorderLayout ()); 77 78 setName(bundle.getString("LBL_UpgradePanel_Name")); 79 txtVersions.setBackground(getBackground()); 80 txtVersions.setColumns(50); 81 txtVersions.setEditable(false); 82 txtVersions.setFont(new java.awt.Font ("Dialog", 0, 12)); 83 txtVersions.setLineWrap(true); 84 txtVersions.setRows(3); 85 txtVersions.setText(NbBundle.getMessage (AutoUpgradePanel.class, "MSG_Confirmation", source)); 86 txtVersions.setWrapStyleWord(true); 87 txtVersions.setMinimumSize(new java.awt.Dimension (100, 50)); 88 add(txtVersions, java.awt.BorderLayout.CENTER); 89 90 } 91 93 private javax.swing.JTextArea txtVersions; 95 97 private static final ResourceBundle bundle = NbBundle.getBundle(AutoUpgradePanel.class); 98 private List <ChangeListener > changeListeners = new ArrayList <ChangeListener >(1); 99 100 } 101 | Popular Tags |