1 19 20 package org.netbeans.modules.j2ee.archive.wizard; 21 22 import java.awt.BorderLayout ; 23 import javax.swing.JComponent ; 24 import javax.swing.SwingUtilities ; 25 26 class StatusPanel extends javax.swing.JPanel { 27 28 29 public StatusPanel() { 30 initComponents(); 31 } 32 33 38 private void initComponents() { 40 currently = new javax.swing.JLabel (); 41 actionDescription = new javax.swing.JLabel (); 42 progressIndicator = new javax.swing.JPanel (); 43 44 currently.setText(org.openide.util.NbBundle.getMessage(StatusPanel.class, "LBL_StatusPanel_currently")); 45 46 progressIndicator.setLayout(new java.awt.BorderLayout ()); 47 48 org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); 49 this.setLayout(layout); 50 layout.setHorizontalGroup( 51 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 52 .add(layout.createSequentialGroup() 53 .add(currently) 54 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 55 .add(actionDescription, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 190, Short.MAX_VALUE)) 56 .add(progressIndicator, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 257, Short.MAX_VALUE) 57 ); 58 layout.setVerticalGroup( 59 layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 60 .add(layout.createSequentialGroup() 61 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 62 .add(currently) 63 .add(actionDescription, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 12, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) 64 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 65 .add(progressIndicator, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 66 .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 67 ); 68 } 70 71 private javax.swing.JLabel actionDescription; 73 private javax.swing.JLabel currently; 74 private javax.swing.JPanel progressIndicator; 75 77 void setIndicator(final JComponent throbber) { 78 progressIndicator.add(throbber, BorderLayout.CENTER); 79 } 80 81 void setActionDescription(final String newValue) { 82 SwingUtilities.invokeLater(new Runnable () { 83 public void run() { 84 actionDescription.setText(newValue); 85 } 86 }); 87 } 88 } 89 | Popular Tags |