1 26 27 package org.objectweb.openccm.explorer.CosTrading.gui; 28 29 30 import java.awt.Color ; 31 import javax.swing.BoxLayout ; 32 import javax.swing.Box ; 33 import javax.swing.border.TitledBorder ; 34 import javax.swing.JScrollPane ; 35 import javax.swing.JTable ; 36 import javax.swing.table.TableModel ; 37 38 39 import org.omg.CosTrading.RegisterPackage.OfferInfo; 40 41 50 public class OfferInfoPanel 51 extends DefaultNodeViewPanel 52 { 53 54 60 61 protected OfferInfo offerInfo_; 62 63 69 72 public OfferInfoPanel() { 73 setBackground(Color.white); 74 setLayout(new BoxLayout (this, BoxLayout.Y_AXIS)); 75 } 76 77 83 89 95 98 public void onSetTreeView() { 99 if (getTreeView() != null) { 100 offerInfo_ = (OfferInfo)getTreeView().getSelectedObject(); 101 if (offerInfo_ != null) { 102 103 javax.swing.JPanel pane = new javax.swing.JPanel (); 104 pane.setBackground(Color.white); 105 pane.setBorder(new TitledBorder (null, " " + offerInfo_.type + " ",TitledBorder.CENTER,TitledBorder.TOP)); 106 107 TableModel dataModel = new OfferPropsTableModel(offerInfo_.properties); 109 JTable table = new JTable (dataModel); 110 table.setBackground(Color.white); 111 112 JScrollPane scroll = new JScrollPane (table); 114 scroll.setBackground(Color.white); 115 scroll.getViewport().setBackground(Color.white); 116 117 Box box = Box.createVerticalBox(); 119 box.add(scroll); 120 121 pane.add(box); 122 123 add(pane); 124 } 125 } 126 } 127 } 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | Popular Tags |