1 24 25 package org.objectweb.cjdbc.console.gui.popups; 26 27 import java.awt.event.ActionEvent ; 28 29 import javax.swing.JMenuItem ; 30 import javax.swing.JTextPane ; 31 32 import org.objectweb.cjdbc.console.gui.CjdbcGui; 33 import org.objectweb.cjdbc.console.gui.constants.GuiCommands; 34 35 41 public class LogEditPopUpMenu extends AbstractPopUpMenu 42 { 43 private JTextPane logConfigTextPane; 44 private String controllerName; 45 46 53 public LogEditPopUpMenu(CjdbcGui gui, String controllerName, 54 JTextPane logConfigTextPane) 55 { 56 super(gui); 57 this.logConfigTextPane = logConfigTextPane; 58 this.controllerName = controllerName; 59 60 this.add( 61 new JMenuItem (GuiCommands.COMMAND_CONTROLLER_UPDATE_LOG_CONFIGURATION)) 62 .addActionListener(this); 63 this.add( 64 new JMenuItem (GuiCommands.COMMAND_CONTROLLER_LOG_CONFIGURATION_DEBUG)) 65 .addActionListener(this); 66 this.add( 67 new JMenuItem (GuiCommands.COMMAND_CONTROLLER_LOG_CONFIGURATION_INFO)) 68 .addActionListener(this); 69 this.add( 70 new JMenuItem (GuiCommands.COMMAND_CONTROLLER_LOG_CONFIGURATION_ADD_SERVER)) 71 .addActionListener(this); 72 this.add( 73 new JMenuItem (GuiCommands.COMMAND_CONTROLLER_LOG_CONFIGURATION_REMOVE_SERVER)) 74 .addActionListener(this); 75 76 } 77 78 81 public void actionPerformed(ActionEvent e) 82 { 83 String action = e.getActionCommand(); 84 if (action.equals(GuiCommands.COMMAND_CONTROLLER_UPDATE_LOG_CONFIGURATION)) 85 gui.publicActionUpdateControllerLogConfiguration(controllerName, 86 logConfigTextPane.getText()); 87 else if (action.equals(GuiCommands.COMMAND_CONTROLLER_LOG_CONFIGURATION_DEBUG)) 88 gui.publicActionSetLogConfigurationDebug(controllerName, 89 logConfigTextPane.getText()); 90 else if (action.equals(GuiCommands.COMMAND_CONTROLLER_LOG_CONFIGURATION_INFO)) 91 gui.publicActionSetLogConfigurationInfo(controllerName, 92 logConfigTextPane.getText()); 93 else if (action.equals(GuiCommands.COMMAND_CONTROLLER_LOG_CONFIGURATION_ADD_SERVER)) 94 gui.publicActionSetLogConfigurationServer(true,controllerName, 95 logConfigTextPane.getText()); 96 else if (action.equals(GuiCommands.COMMAND_CONTROLLER_LOG_CONFIGURATION_REMOVE_SERVER)) 97 gui.publicActionSetLogConfigurationServer(false,controllerName, 98 logConfigTextPane.getText()); 99 } 100 } 101 | Popular Tags |