1 4 package com.tc; 5 6 import org.dijon.CheckBox; 7 import org.dijon.Container; 8 import org.dijon.ContainerResource; 9 import org.dijon.Label; 10 import org.dijon.List; 11 import org.dijon.ListModel; 12 13 public class InstrumentSuperTypesPanel extends Container { 14 private Label m_messageArea; 15 private Container m_superTypesPanel; 16 private Container m_superTypesStandin; 17 private List m_superTypesList; 18 private Container m_bootTypesPanel; 19 private Container m_bootTypesStandin; 20 private List m_bootTypesList; 21 private CheckBox m_restartToggle; 22 23 public InstrumentSuperTypesPanel(ContainerResource res) { 24 super(res); 25 } 26 27 public void load(ContainerResource res) { 28 super.load(res); 29 30 m_messageArea = (Label)findComponent("MessageArea"); 31 m_superTypesPanel = (Container)findComponent("SuperTypesPanel"); 32 m_superTypesList = (List)m_superTypesPanel.findComponent("SuperTypesList"); 33 m_superTypesStandin = new Container(); 34 m_bootTypesPanel = (Container)findComponent("BootTypesPanel"); 35 m_bootTypesList = (List)m_bootTypesPanel.findComponent("BootTypesList"); 36 m_bootTypesStandin = new Container(); 37 m_restartToggle = (CheckBox)findComponent("RestartToggle"); 38 } 39 40 public void setup(String msg, 41 String className, 42 java.util.List bootTypes, 43 java.util.List superTypes) 44 { 45 m_messageArea.setText(msg); 46 47 if(superTypes.size() > 0) { 48 if(m_superTypesPanel.getParent() == null) { 49 replaceChild(m_superTypesStandin, m_superTypesPanel); 50 } 51 m_superTypesList.setModel(new ListModel(superTypes)); 52 } 53 else if(m_superTypesPanel.getParent() != null) { 54 replaceChild(m_superTypesPanel, m_superTypesStandin); 55 } 56 57 if(bootTypes.size() > 0) { 58 if(m_bootTypesPanel.getParent() == null) { 59 replaceChild(m_bootTypesStandin, m_bootTypesPanel); 60 } 61 m_bootTypesList.setModel(new ListModel(bootTypes)); 62 } 63 else if(m_bootTypesPanel.getParent() != null) { 64 replaceChild(m_bootTypesPanel, m_bootTypesStandin); 65 } 66 67 m_restartToggle.setSelected(true); 68 } 69 70 public boolean restartSystem() { 71 return m_restartToggle.isSelected(); 72 } 73 } 74
| Popular Tags
|