1 19 20 package org.netbeans.modules.refactoring.vcs; 21 22 import java.awt.Component ; 23 import java.util.Collection ; 24 import javax.swing.DefaultListCellRenderer ; 25 import javax.swing.JList ; 26 import org.openide.filesystems.FileObject; 27 import org.openide.filesystems.FileUtil; 28 29 33 public class CheckoutPanel extends javax.swing.JPanel { 34 35 39 public CheckoutPanel(Collection files) { 40 initComponents(); 41 fileList.setListData(files.toArray()); 42 fileList.setCellRenderer(new DefaultListCellRenderer () { 43 public Component getListCellRendererComponent( 44 JList list, 45 Object value, 46 int index, 47 boolean isSelected, 48 boolean cellHasFocus) 49 { 50 super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 51 setText("<html>" + ((FileObject) value).getNameExt() + " <font color=#707070>(" + FileUtil.getFileDisplayName((FileObject) value) + ")</font></html>"); return this; 53 } 54 55 56 }); 57 } 58 59 64 private void initComponents() { 66 topLabel = new javax.swing.JLabel (); 67 progressBar = new javax.swing.JProgressBar (); 68 scrollPane = new javax.swing.JScrollPane (); 69 fileList = new javax.swing.JList (); 70 71 setLayout(new java.awt.BorderLayout (0, 6)); 72 73 setBorder(new javax.swing.border.EmptyBorder (new java.awt.Insets (12, 12, 11, 11))); 74 org.openide.awt.Mnemonics.setLocalizedText(topLabel, org.openide.util.NbBundle.getMessage(CheckoutPanel.class, "LBL_FilesToUpdate")); 75 add(topLabel, java.awt.BorderLayout.NORTH); 76 77 add(progressBar, java.awt.BorderLayout.SOUTH); 78 79 scrollPane.setViewportView(fileList); 80 81 add(scrollPane, java.awt.BorderLayout.CENTER); 82 83 } 84 86 87 private javax.swing.JList fileList; 89 private javax.swing.JProgressBar progressBar; 90 private javax.swing.JScrollPane scrollPane; 91 private javax.swing.JLabel topLabel; 92 94 } 95 | Popular Tags |