}
}
private void buildMenuTree(String menuID, DefaultMutableTreeNode node, JMenuBar menubar, int level, JMenu menu) {
JDBModule m = new JDBModule(Common.selectedHostID, Common.sessionID);
try
{
// logger.debug("buildMenuTree :"+node);
PreparedStatement stmt;
ResultSet rs;
stmt = Common.hostList.getHost(Common.selectedHostID).getConnection(Common.sessionID).prepareStatement(Common.hostList.getHost(Common.selectedHostID).getSqlstatements().getSQL("JInternalFrameMenuTree.buildMenuTree"));
stmt.setString(1, menuID);
stmt.setString(2, Common.userList.getUser(Common.sessionID).getUserId());
stmt.setFetchSize(25);
rs = stmt.executeQuery();
while (rs.next())
{
JMenuOption menuOption = new JMenuOption(Common.selectedHostID, Common.sessionID);
menuOption.load(rs);
DefaultMutableTreeNode newnode = new DefaultMutableTreeNode(menuOption);
node.add(newnode);
if (menuOption.moduleType.equals("MENU"))
{
JMenu newmenu = new JMenu(menuOption.description);
newmenu.setFont(Common.font_menu);
newmenu.setMnemonic(menuOption.mnemonic);
if (level == 0)
{
menubar.add(newmenu);
}
else
{
newmenu.setIcon(Common.icon_menu);
menu.add(newmenu);
}
buildMenuTree(menuOption.moduleID, newnode, menubar, level + 1, newmenu);
}
else
{
JMenuItem newmenuitem = new JMenuPulldownMenuItem(menuOption);
m.setModuleId(menuOption.moduleID);
m.getModuleProperties();
String type = m.getType();
newmenuitem.setIcon(JDBModule.getModuleIcon(m.getIconFilename(), type));
newmenuitem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
JMenuPulldownMenuItem o = (JMenuPulldownMenuItem) evt.getSource();
if (o.getModuleType().equals("FORM"))