Package com.commander4j.db

Examples of com.commander4j.db.JDBModule


    String result = "";

    try
    {
      JDBModule m = new JDBModule(Common.selectedHostID, Common.sessionID);
      m.setModuleId(moduleid);

      if (m.getModuleProperties())
      {
        result = m.getHelpSetID();

        if (result == null)
        {
          result = "http://commander4j.com/mw/index.php?title=No_Help_Found";
        }
View Full Code Here


    }
  }

  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"))
View Full Code Here

  }

  private void populateAssignedList() {
    assignedModel.removeAllElements();

    JDBModule mod = new JDBModule(Common.selectedHostID, Common.sessionID);

    assignedList = mod.getModulesAssignedtoToolbar();

    if (assignedList.size() > 0)
    {
      for (int j = 0; j < assignedList.size(); j++)
      {
View Full Code Here

  }

  private void populateUnAssignedList() {
    unassignedModel.removeAllElements();

    JDBModule mod = new JDBModule(Common.selectedHostID, Common.sessionID);

    unassignedList = mod.getModulesUnAssignedtoToolbar();

    if (unassignedList.size() > 0)
    {
      for (int j = 0; j < unassignedList.size(); j++)
      {
View Full Code Here

  }

  private void populateMenuList() {
    menuModel.removeAllElements();

    JDBModule mod = new JDBModule(Common.selectedHostID, Common.sessionID);
    this.setIconifiable(true);

    menuList = mod.getMenuIds();

    for (int j = 0; j < menuList.size(); j++)
    {
      menuModel.addElement(menuList.get(j));
    }
View Full Code Here

  }

  private void populateUnAssignedList(JDBListData i) {
    unassignedModel.removeAllElements();

    JDBModule mod = new JDBModule(Common.selectedHostID, Common.sessionID);
    mod.setModuleId(i.toString());

    unassignedList = mod.getModulesUnAssignedtoMenu();

    if (unassignedList.size() > 0)
    {
      for (int j = 0; j < unassignedList.size(); j++)
      {
View Full Code Here

  }

  private void populateAssignedList(JDBListData i) {
    assignedModel.removeAllElements();

    JDBModule mod = new JDBModule(Common.selectedHostID, Common.sessionID);
    mod.setModuleId(i.toString());

    assignedList = mod.getModulesAssignedtoMenu();

    if (assignedList.size() > 0)
    {
      for (int j = 0; j < assignedList.size(); j++)
      {
View Full Code Here

    }
  }

  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"))
View Full Code Here

    String result = "";

    try
    {
      JDBModule m = new JDBModule(Common.selectedHostID, Common.sessionID);
      m.setModuleId(moduleid);

      if (m.getModuleProperties())
      {
        result = m.getHelpSetID();

        if (result == null)
        {
          result = "http://commander4j.com/mw/index.php?title=No_Help_Found";
        }
View Full Code Here

TOP

Related Classes of com.commander4j.db.JDBModule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.