public void actionPerformed(ActionEvent arg0)
{
try
{
ConnectionConfig cConfig = (ConnectionConfig) factoryConfig.getConnection().get(0);
SessionConfig sConfig = (SessionConfig) cConfig.getSession().get(0);
DestinationConfig dConfig = new DestinationConfig() ;
dConfig.setDomain(Domain.QUEUE.getId()) ;
dConfig.setName("NEW") ;
destinationTableModel.addItem(dConfig) ;
doEdit(sConfig.getId(), dConfig);
dialog.setDirty();
}
catch (Exception ex)
{
cat.error(ex.getMessage(), ex);
}
}
});
removeItem.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent arg0)
{
for (int row : destinationTable.getSelectedRows())
{
if (row >= 0)
{
int realRow = destinationTable.getActualRowAt(row);
destinationTableModel.removeRow(realRow);
dialog.setDirty();
}
}
}
});
mouseAdapter = new MouseAdapter()
{
public void mousePressed(MouseEvent e)
{
if (SwingUtilities.isRightMouseButton(e))
{
if (e.getComponent() == destinationTableSP)
{
removeItem.setEnabled(false);
}
else
{
removeItem.setEnabled(true);
}
popupMenu.show(e.getComponent(), e.getX(), e.getY());
}
else if (e.getClickCount() == 2)
{
int row = destinationTable.getActualRowAt(destinationTable.getSelectedRow());
if (row >= 0)
{
ConnectionConfig cConfig = (ConnectionConfig) factoryConfig.getConnection().get(0);
SessionConfig sConfig = (SessionConfig) cConfig.getSession().get(0);
doEdit(sConfig.getId(), destinationTableModel.getRowConfig(row));
}
}
}
};