1 4 package org.oddjob.designer.view; 5 6 import java.awt.Component ; 7 import java.util.Observable ; 8 import java.util.Observer ; 9 10 import javax.swing.JPanel ; 11 import javax.swing.JScrollPane ; 12 13 import org.oddjob.designer.model.DesignTreeNode; 14 import org.oddjob.designer.model.DesignerModel; 15 16 19 public class DesignerDetail extends JScrollPane implements Observer { 20 21 24 public void update(Observable o, Object arg) { 25 DesignerModel model = (DesignerModel) o; 26 DesignTreeNode node = model.getCurrentSelection(); 27 Component component = null; 28 if (node != null) { 29 component = node.getDetailView(); 30 } 31 32 if (component != null) { 33 setViewportView(component); 34 } 35 else { 36 setViewportView(new JPanel ()); 37 } 38 } 39 40 } 41 | Popular Tags |