1 24 package org.aspectj.debugger.gui; 25 26 import javax.swing.*; 27 import java.awt.event.*; 28 29 public class CommandLinePanel extends JPanel{ 30 private JCheckBox cb = new JCheckBox("", false); 31 private JComponent jc = null; 32 { 33 cb.addItemListener(new ItemListener() { 34 public void itemStateChanged(ItemEvent e) { 35 jc.setVisible(e.getStateChange() == ItemEvent.DESELECTED ? false : true); 36 } 37 }); 38 cb.setToolTipText("Show command line"); 39 } 40 final static GUIDebugger guid() { 41 return ComponentRepository.getGUIDebugger(); 42 } 43 public CommandLinePanel(boolean setVisible) { 44 this(guid(), setVisible); 45 } 46 public CommandLinePanel() { 47 this(guid()); 48 } 49 public CommandLinePanel(GUIDebugger guid) { 50 this(guid, System.getProperty("user.name").equals("palm")); 51 } 52 public CommandLinePanel(GUIDebugger guid, boolean setVisible) { 53 super(); 54 setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); 55 add(cb); 56 jc = ComponentRepository.getCommandLine(); 57 add(jc); 58 jc.setVisible(setVisible); 59 } 60 } 61 | Popular Tags |