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.table.TableModel ; 35 import javax.swing.JTable ; 36 import javax.swing.JScrollPane ; 37 38 39 import org.omg.CosTrading.Offer; 40 41 50 public class OfferPanel 51 extends DefaultNodeViewPanel 52 { 53 54 60 61 protected Offer offer_; 62 63 69 72 public OfferPanel() { 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 offer_ = (Offer)getTreeView().getSelectedObject(); 101 if (offer_ != null) { 102 103 javax.swing.JPanel pane = new javax.swing.JPanel (); 104 pane.setBackground(Color.white); 105 pane.setBorder(new TitledBorder (null, " Properties ",TitledBorder.CENTER,TitledBorder.TOP)); 106 107 TableModel dataModel = new OfferPropsTableModel(offer_.properties); 109 JTable table = new JTable (dataModel); 110 table.setBackground(Color.white); 111 112 JScrollPane scroll = new JScrollPane (table); 114 scroll.getViewport().setBackground(Color.white); 115 scroll.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 |