Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.console.gui.CjdbcGuiListener Class Reference

Collaboration diagram for org.objectweb.cjdbc.console.gui.CjdbcGuiListener:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CjdbcGuiListener (CjdbcGui gui)
void handleNotification (Notification notification, Object handback)
void mouseClicked (MouseEvent e)
void mousePressed (MouseEvent e)
void mouseReleased (MouseEvent e)
void mouseEntered (MouseEvent e)
void mouseExited (MouseEvent e)
void actionPerformed (ActionEvent e)
void focusGained (FocusEvent e)
void focusLost (FocusEvent e)
void valueChanged (ListSelectionEvent e)

Static Package Attributes

final int JMX_SEQUENCE_CACHE = 100

Detailed Description

This class defines a CjdbcGuiListener

Author:
Nicolas Modrzyk

Emmanuel Cecchet

Version:
1.0

Definition at line 62 of file CjdbcGuiListener.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.console.gui.CjdbcGuiListener.CjdbcGuiListener CjdbcGui  gui  ) 
 

Creates a new CjdbcGuiListener.java object

Parameters:
gui the main frame

Definition at line 79 of file CjdbcGuiListener.java.

00080   {
00081     this.gui = gui;
00082   }


Member Function Documentation

void org.objectweb.cjdbc.console.gui.CjdbcGuiListener.actionPerformed ActionEvent  e  ) 
 

See also:
java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)

Definition at line 299 of file CjdbcGuiListener.java.

References org.objectweb.cjdbc.console.gui.CjdbcGui.appendDebugText(), org.objectweb.cjdbc.console.gui.CjdbcGui.getSelectedController(), org.objectweb.cjdbc.console.gui.CjdbcGui.inputBackupFrame, org.objectweb.cjdbc.console.gui.CjdbcGui.newBackendFrame, org.objectweb.cjdbc.console.gui.CjdbcGui.newControllerFrame, org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionAddController(), org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionAddControllerView(), org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionAddXmlFile(), org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionCleanDebugBuffer(), org.objectweb.cjdbc.console.gui.CjdbcGui.publicActioncleanLoggingPane(), org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionCreateBackendExecute(), org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionLoadAuthenticatedDatabase(), org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionQuit(), org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionSaveConfigurationFile(), org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionSelectNewController(), org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionSelectNewDatabase(), org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionStartMonitor(), org.objectweb.cjdbc.console.gui.CjdbcGui.selectCheckpointFrame, and org.objectweb.cjdbc.console.gui.CjdbcGui.selectShutdownFrame.

00300   {
00301     String action = e.getActionCommand();
00302     gui.appendDebugText("Got action:" + action);
00303     if (action.equals(GuiCommands.COMMAND_QUIT))
00304     {
00305       gui.publicActionQuit();
00306     }
00307     else if (action.equals(GuiCommands.COMMAND_ADD_CONTROLLER))
00308     {
00309       gui.publicActionAddControllerView();
00310     }
00311     else if (action.equals(GuiCommands.COMMAND_SAVE_CONFIGURATION_FILE))
00312     {
00313       gui.publicActionSaveConfigurationFile();
00314     }
00315     if (action.equals(GuiCommands.COMMAND_CLEAN_LOGGING_PANEL))
00316     {
00317       gui.publicActioncleanLoggingPane();
00318     }
00319     else if (action.equals(GuiCommands.COMMAND_ADD_CONFIG_FILE))
00320     {
00321       gui.publicActionAddXmlFile();
00322     }
00323     else if (action.equals(GuiCommands.COMMAND_SELECT_CONTROLLER))
00324     {
00325       String controllerName = ((JButton) e.getSource()).getName();
00326       gui.appendDebugText("Changed controller selection to:" + controllerName);
00327       gui.publicActionSelectNewController(controllerName);
00328     }
00329     else if (action.equals(GuiCommands.COMMAND_SELECT_DATABASE))
00330     {
00331       DatabaseObject source = (DatabaseObject) e.getSource();
00332       String databaseName = source.getName();
00333       gui.appendDebugText("Changed database selection to:" + databaseName);
00334       gui.publicActionSelectNewDatabase(databaseName);
00335     }
00336     else if (action.equals(GuiCommands.COMMAND_ADD_CONTROLLER_CANCEL))
00337     {
00338       gui.newControllerFrame.setVisible(false);
00339     }
00340     else if (action.equals(GuiCommands.COMMAND_ADD_CONTROLLER_APPROVE))
00341     {
00342       gui.publicActionAddController();
00343     }
00344     else if (action.equals(GuiCommands.COMMAND_SAVE_CONFIGURATION_FILE))
00345     {
00346       gui.publicActionSaveConfigurationFile();
00347     }
00348     else if (action.equals(GuiCommands.COMMAND_CLEAN_DEBUG_BUFFER))
00349     {
00350       gui.publicActionCleanDebugBuffer();
00351     }
00352     else if (action.equals(GuiCommands.COMMAND_DATABASE_AUTHENTICATE))
00353     {
00354       gui.publicActionLoadAuthenticatedDatabase();
00355     }
00356     else if (action.equals(GuiCommands.COMMAND_CREATE_BACKEND_APPROVE))
00357     {
00358       gui.publicActionCreateBackendExecute();
00359     }
00360     else if (action.equals(GuiCommands.COMMAND_CREATE_BACKEND_CANCEL))
00361     {
00362       gui.newBackendFrame.setVisible(false);
00363     }
00364     else if (action.equals(GuiCommands.COMMAND_HIDE_CHECKPOINT_FRAME))
00365     {
00366       gui.selectCheckpointFrame.setVisible(false);
00367     }
00368     else if (action.equals(GuiCommands.COMMAND_HIDE_SHUTDOWN_FRAME))
00369     {
00370       gui.selectShutdownFrame.setVisible(false);
00371     }
00372     else if (action.equals(GuiCommands.COMMAND_HIDE_BACKUP_FRAME))
00373     {
00374       gui.inputBackupFrame.setVisible(false);
00375     }
00376     else if (action.equals(GuiCommands.COMMAND_MONITOR_CURRENT_CONTROLLER))
00377     {
00378       gui.publicActionStartMonitor(gui.getSelectedController(), true, true,
00379           true);
00380     }
00381 
00382   }

void org.objectweb.cjdbc.console.gui.CjdbcGuiListener.focusGained FocusEvent  e  ) 
 

See also:
java.awt.event.FocusListener#focusGained(java.awt.event.FocusEvent)

Definition at line 387 of file CjdbcGuiListener.java.

References org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionRefreshMBeans(), and org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionTileJmxFrames().

00388   {
00389     gui.publicActionTileJmxFrames(false);
00390     gui.publicActionRefreshMBeans();
00391   }

void org.objectweb.cjdbc.console.gui.CjdbcGuiListener.focusLost FocusEvent  e  ) 
 

See also:
java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)

Definition at line 396 of file CjdbcGuiListener.java.

00397   {
00398 
00399   }

void org.objectweb.cjdbc.console.gui.CjdbcGuiListener.handleNotification Notification  notification,
Object  handback
 

Handle jmx notifications

Parameters:
notification the jmx notification from javax.managerment
handback not used

Definition at line 90 of file CjdbcGuiListener.java.

References org.objectweb.cjdbc.console.gui.CjdbcGui.appendDebugText(), org.objectweb.cjdbc.common.jmx.notifications.JmxNotification.getType(), and org.objectweb.cjdbc.common.jmx.notifications.JmxNotification.toString().

00091   {
00092     String xml = (String) notification.getUserData();
00093     // If the content of the notification is null, just debug it
00094     if (xml == null)
00095     {
00096       gui.appendDebugText("Got notification with null string");
00097       return;
00098     }
00099     try
00100     {
00101       JmxNotification notif = JmxNotification
00102           .createNotificationFromXmlString(xml);
00103       gui.appendDebugText("----- Jmx Notification -------");
00104       gui.appendDebugText(notif.toString());
00105       gui.appendDebugText("-----------------------------------");
00106       handleNotification(notif.getType(), notif);
00107     }
00108     catch (Exception e)
00109     {
00110       gui.appendDebugText("Exception while handling notification", e);
00111     }
00112   }

void org.objectweb.cjdbc.console.gui.CjdbcGuiListener.mouseClicked MouseEvent  e  ) 
 

See also:
java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)

Definition at line 231 of file CjdbcGuiListener.java.

References org.objectweb.cjdbc.console.gui.CjdbcGui.appendDebugText(), org.objectweb.cjdbc.console.gui.CjdbcGui.getAttributeChangeDialog(), org.objectweb.cjdbc.console.gui.CjdbcGui.getOperationCallDialog(), and org.objectweb.cjdbc.console.gui.CjdbcGui.mbeanList.

00232   {
00233 
00234     if (e.getClickCount() <= 1)
00235     {
00236       return;
00237     }
00238     if (e.getSource() instanceof JTable)
00239     {
00240       JTable table = (JTable) e.getSource();
00241       if (table.getName().equals(GuiConstants.TABLE_JMX_ATTRIBUTES))
00242       {
00243         int row = table.getSelectedRow();
00244         AttributeModel model = (AttributeModel) table.getModel();
00245         MBeanAttributeInfo[] info = model.getInfo();
00246         Object o = gui.mbeanList.getSelectedValue();
00247         gui.appendDebugText("Got attribute selection for mbean:" + o
00248             + " and attribute is:" + info[row].getName());
00249         gui.getAttributeChangeDialog((ObjectName) o, info[row]);
00250       }
00251       if (table.getName().equals(GuiConstants.TABLE_JMX_OPERATIONS))
00252       {
00253         int row = table.getSelectedRow();
00254         OperationModel model = (OperationModel) table.getModel();
00255         MBeanOperationInfo[] info = model.getInfo();
00256         Object o = gui.mbeanList.getSelectedValue();
00257         gui.appendDebugText("Got operation selection for mbean:" + o
00258             + " and operation is:" + info[row].getName());
00259         gui.getOperationCallDialog((ObjectName) o, info[row]);
00260       }
00261     }
00262   }

void org.objectweb.cjdbc.console.gui.CjdbcGuiListener.mouseEntered MouseEvent  e  ) 
 

See also:
java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)

Definition at line 283 of file CjdbcGuiListener.java.

00284   {
00285 
00286   }

void org.objectweb.cjdbc.console.gui.CjdbcGuiListener.mouseExited MouseEvent  e  ) 
 

See also:
java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)

Definition at line 291 of file CjdbcGuiListener.java.

00292   {
00293 
00294   }

void org.objectweb.cjdbc.console.gui.CjdbcGuiListener.mousePressed MouseEvent  e  ) 
 

See also:
java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)

Definition at line 267 of file CjdbcGuiListener.java.

00268   {
00269 
00270   }

void org.objectweb.cjdbc.console.gui.CjdbcGuiListener.mouseReleased MouseEvent  e  ) 
 

See also:
java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)

Definition at line 275 of file CjdbcGuiListener.java.

00276   {
00277 
00278   }

void org.objectweb.cjdbc.console.gui.CjdbcGuiListener.valueChanged ListSelectionEvent  e  ) 
 

See also:
javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)

Definition at line 404 of file CjdbcGuiListener.java.

References org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionRefreshMBeanAttributes(), and org.objectweb.cjdbc.console.gui.CjdbcGui.publicActionRefreshMBeanMethods().

00405   {
00406     JList list = (JList) e.getSource();
00407     ObjectName name = (ObjectName) list.getSelectedValue();
00408     gui.publicActionRefreshMBeanAttributes(name);
00409     gui.publicActionRefreshMBeanMethods(name);
00410   }


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:02:17 2005 for C-JDBC by  doxygen 1.3.9.1