Examples of DropDownMenu


Examples of com.jada.ui.dropdown.DropDownMenu

        if (menu.getMenuSetName().equals(Constants.MENUSET_SECONDARY)) {
          continue;
        }
        menuVector.add(makeMenuTree(siteDomainId, menu.getMenuSetName(), siteProfileClassId));
      }
      DropDownMenu ddmList[] = new DropDownMenu[menuVector.size()];
      menuVector.copyInto(ddmList);
      return ddmList;
    }
View Full Code Here

Examples of com.jada.ui.dropdown.DropDownMenu

      Iterator<?> iterator = query.getResultList().iterator();
      Menu menu = null;
      if (iterator.hasNext()) {
        menu = (Menu) iterator.next();
       }
        DropDownMenu menus[] = makeMenu(siteDomainId, menuSetName, menu.getMenuId(), siteProfileClassId, menu.getSiteDomain().getSite().getSiteProfileClassDefault().getSiteProfileClassId());
        DropDownMenu ddm = new DropDownMenu();
        ddm.setMenuName(menu.getMenuSetName());
        ddm.setMenuKey(Format.getLong(menu.getMenuId()));
        ddm.setMenuItems(menus);
       
      return ddm;
    }
View Full Code Here

Examples of com.jada.ui.dropdown.DropDownMenu

      return ddm;
    }
   

    static public DropDownMenu[] makeMenu(Long siteDomainId, String menuSetName, Long menuParentId, Long siteProfileClassId, Long siteProfileClassDefaultId) throws Exception {
      DropDownMenu menus[] = null;
      Vector<DropDownMenu> menuList = new Vector<DropDownMenu>();
     
      SiteDomain siteDomain = SiteDomainDAO.load(siteDomainId);
      Menu parent = MenuDAO.load(siteDomain.getSite().getSiteId(), menuParentId);
      for (Menu menu : parent.getMenuChildren()) {
        MenuLanguage defaultMenuLanguage = null;
        for (MenuLanguage language : menu.getMenuLanguages()) {
          if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassDefaultId)) {
            defaultMenuLanguage = language;
          }
        }
       
           DropDownMenu ddm = new DropDownMenu();
           ddm.setMenuKey(Format.getLong(menu.getMenuId()));
         ddm.setMenuName(defaultMenuLanguage.getMenuName());
           if (siteProfileClassId != siteProfileClassDefaultId) {
             Iterator<?> menuLanguages = menu.getMenuLanguages().iterator();
             boolean found = false;
             MenuLanguage menuLanguage = null;
             while (menuLanguages.hasNext()) {
                   menuLanguage = (MenuLanguage) menuLanguages.next();
                   if (menuLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
                     found = true;
                     break;
                   }
             }
             if (found) {
               if (menuLanguage.getMenuName() != null) {
                 ddm.setMenuName(menuLanguage.getMenuName());
               }
             }
           }
        if (menu.getMenuId() != null) {
          DropDownMenu childMenus[] = makeDdmMenu(siteDomainId, menuSetName, menu.getMenuId(), siteProfileClassId, siteProfileClassDefaultId);
               ddm.setMenuItems(childMenus);
        }
        menuList.add(ddm)
      }
      menus = new DropDownMenu[menuList.size()];
View Full Code Here

Examples of com.jada.ui.dropdown.DropDownMenu

      if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassDefaultId)) {
        categoryLanguage = language;
      }
    }
   
      DropDownMenu categories[] = null;
    categories = makeCategoryTreeItem(siteId, category.getCatId(), siteProfileClassId, siteProfileClassDefaultId);
   
      DropDownMenu ddm = new DropDownMenu();
      ddm.setMenuKey(category.getCatId().toString());
      ddm.setMenuName(categoryLanguage.getCatShortTitle());
      ddm.setMenuItems(categories);

      return ddm;
    }
View Full Code Here

Examples of com.jada.ui.dropdown.DropDownMenu

      return ddm;
    }
   
    static public DropDownMenu[] makeCategoryTreeItem(String siteId, Long categoryParentId, Long siteProfileClassId, Long siteProfileClassDefaultId) throws Exception {
      DropDownMenu categories[] = null;
      Vector<DropDownMenu> categoryList = new Vector<DropDownMenu>();
     
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      String sql = "select category " +
            "from   Category category " +
             "left   join category.site site " +
                   "where  site.siteId = :siteId " +
                   "and    category.categoryParentId = :categoryParentId " +
             "order  by category.seqNum";
      Query query = em.createQuery(sql);
      query.setParameter("siteId", siteId);
      query.setParameter("categoryParentId", categoryParentId.longValue());
      Iterator<?> iterator = query.getResultList().iterator();
      while (iterator.hasNext()) {
        Category category = (Category) iterator.next();
      CategoryLanguage categoryLanguage = null;
      for (CategoryLanguage language : category.getCategoryLanguages()) {
        if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassDefaultId)) {
          categoryLanguage = language;
        }
      }
     
           DropDownMenu childMenus[] = makeDdmCategory(siteId, category.getCatId(), siteProfileClassId, siteProfileClassDefaultId);
           DropDownMenu ddm = new DropDownMenu();
           ddm.setMenuKey(Format.getLong(category.getCatId()));
           ddm.setMenuName(categoryLanguage.getCatShortTitle());
           if (siteProfileClassId != siteProfileClassDefaultId) {
             Iterator<?> categoryLanguages = category.getCategoryLanguages().iterator();
             boolean found = false;
             while (categoryLanguages.hasNext()) {
               categoryLanguage = (CategoryLanguage) categoryLanguages.next();
                   if (categoryLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
                     found = true;
                     break;
                   }
             }
             if (found) {
               if (categoryLanguage.getCatShortTitle() != null) {
                 ddm.setMenuName(categoryLanguage.getCatShortTitle());
               }
             }
           }
           ddm.setMenuItems(childMenus);
           categoryList.add(ddm);
      }
      categories = new DropDownMenu[categoryList.size()];
      categoryList.copyInto(categories);
      return categories;
View Full Code Here

Examples of com.jada.ui.dropdown.DropDownMenu

        container.setMenuItems(categories);
      return container;
    }
*/
    static public DropDownMenu[] makeDdmCategory(String siteId, Long categoryParentId, Long siteProfileClassId, Long siteProfileClassDefaultId) throws Exception {
      DropDownMenu categories[] = null;
      Vector<DropDownMenu> categoryList = new Vector<DropDownMenu>();
     
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
      String sql = "select category " +
            "from   Category category " +
            "left   join category.site site " +
            "where  site.siteId = :siteId " +
            "and    category.categoryParentId = :categoryParentId " +
            "order  by category.seqNum";
      Query query = em.createQuery(sql);
      query.setParameter("siteId", siteId);
      query.setParameter("categoryParentId", categoryParentId.longValue());
      Iterator<?> iterator = query.getResultList().iterator();
      while (iterator.hasNext()) {
        Category category = (Category) iterator.next();
      CategoryLanguage categoryLanguage = null;
      for (CategoryLanguage language : category.getCategoryLanguages()) {
        if (language.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassDefaultId)) {
          categoryLanguage = language;
        }
      }
           DropDownMenu childMenus[] = makeDdmCategory(siteId, category.getCatId(), siteProfileClassId, siteProfileClassDefaultId);
           DropDownMenu ddm = new DropDownMenu();
           ddm.setMenuKey(Format.getLong(category.getCatId()));
           ddm.setMenuName(categoryLanguage.getCatShortTitle());
           if (siteProfileClassId != siteProfileClassDefaultId) {
             Iterator<?> categoryLanguages = category.getCategoryLanguages().iterator();
             boolean found = false;
             while (categoryLanguages.hasNext()) {
               categoryLanguage = (CategoryLanguage) categoryLanguages.next();
                   if (categoryLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
                     found = true;
                     break;
                   }
             }
             if (found) {
               if (categoryLanguage.getCatShortTitle() != null) {
                 ddm.setMenuName(categoryLanguage.getCatShortTitle());
               }
             }
           }
           ddm.setMenuItems(childMenus);
           categoryList.add(ddm);
      }
      categories = new DropDownMenu[categoryList.size()];
      categoryList.copyInto(categories);
      return categories;
View Full Code Here

Examples of com.jada.ui.dropdown.DropDownMenu

      return container;
    }
*/

    static public DropDownMenu[] makeDdmMenu(Long siteDomainId, String menuSetName, Long menuParentId, Long siteProfileClassId, Long siteProfileClassDefaultId) throws Exception {
      DropDownMenu menus[] = null;
      Vector<DropDownMenu> menuList = new Vector<DropDownMenu>();
     
      SiteDomain siteDomain = SiteDomainDAO.load(siteDomainId);
      Menu parent = MenuDAO.load(siteDomain.getSite().getSiteId(), menuParentId);
      for (Menu menu : parent.getMenuChildren()) {
        MenuLanguage defaultMenuLanguage = null;
        for (MenuLanguage language : menu.getMenuLanguages()) {
          if (language.getSiteProfileClass().getSiteProfileClassId().equals(menu.getSiteDomain().getSite().getSiteProfileClassDefault().getSiteProfileClassId())) {
            defaultMenuLanguage = language;
          }
        }
       
           DropDownMenu ddm = new DropDownMenu();
           ddm.setMenuKey(Format.getLong(menu.getMenuId()));
           ddm.setMenuName(defaultMenuLanguage.getMenuName());
           if (siteProfileClassId != siteProfileClassDefaultId) {
             Iterator<?> menuLanguages = menu.getMenuLanguages().iterator();
             boolean found = false;
             MenuLanguage menuLanguage = null;
             while (menuLanguages.hasNext()) {
                   menuLanguage = (MenuLanguage) menuLanguages.next();
                   if (menuLanguage.getSiteProfileClass().getSiteProfileClassId().equals(siteProfileClassId)) {
                     found = true;
                     break;
                   }
             }
             if (found) {
               if (menuLanguage.getMenuName() != null) {
                 ddm.setMenuName(menuLanguage.getMenuName());
               }
             }
           }
           if (menu.getMenuId() != null) {
          DropDownMenu childMenus[] = makeDdmMenu(siteDomainId, menuSetName, menu.getMenuId(), siteProfileClassId, siteProfileClassDefaultId);
               ddm.setMenuItems(childMenus);
        }
        menuList.add(ddm);
      }
      menus = new DropDownMenu[menuList.size()];
View Full Code Here

Examples of com.pointcliki.ui.DropDownMenu

  }
 
  private void createLogicEditor() {
    fItem = "";
    // Add settings
    final DropDownMenu type = new DropDownMenu(new Minion<SelectionEvent>() {
      @Override
      public long run(Dispatcher<SelectionEvent> dispatcher, String t, SelectionEvent event) {
        fType = ((DropDownMenu) event.source()).value();
        try {
          fSubType = JSONObject.getNames(fLogics.getJSONObject(fType))[0];
        } catch (JSONException e) {
          System.err.println("Can't parse subtype");
          System.err.println(e.getMessage());
        }
        editLogic(null);
        return Minion.CONTINUE;
      }
    });
    for (String s: JSONObject.getNames(fLogics)) type.add(s);
    type.select(fType);
    type.resize(new Vector2f(155, 24));
    addChild(type, 10);
   
    final DropDownMenu subtype = new DropDownMenu(new Minion<SelectionEvent>() {
      @Override
      public long run(Dispatcher<SelectionEvent> dispatcher, String type, SelectionEvent event) {
        fSubType = ((DropDownMenu) event.source()).value();
        editLogic(null);
        return Minion.CONTINUE;
      }
    });
    subtype.position(new Vector2f(0, 26));
    try {
      for (String s: JSONObject.getNames(fLogics.getJSONObject(fType))) subtype.add(s);
    } catch (JSONException e) {
      System.err.println("Error parsing the editor preset logics");
      System.err.println(e.getMessage());
    }
    subtype.select(fSubType);
    subtype.resize(new Vector2f(155, 24));
    addChild(subtype, 9);
   
    fLogicPane = new LogicPane();
    fLogicPane.position(new Vector2f(0, 56));
    addChild(fLogicPane);   
View Full Code Here

Examples of com.pointcliki.ui.DropDownMenu

              return Minion.CONTINUE;
            }
          });
          addChild(box, n);
        } else {
          DropDownMenu drop = new DropDownMenu(new Minion<SelectionEvent>() {
            @Override
            public long run(Dispatcher<SelectionEvent> dispatcher, String type, SelectionEvent event) {
              s.choice(event.value());
              editLogic(l);
              return Minion.CONTINUE;
            }
          });
          drop.position(new Vector2f(0, i)).resize(new Vector2f(155, 24));
          for (String str: choices) drop.add(str.toLowerCase());
          if (!s.value().equals("")) drop.select(s.value().toLowerCase());
          addChild(drop, n);
        }
      }
      n--;
      i += 26;
View Full Code Here

Examples of com.pointcliki.ui.DropDownMenu

  public void init() {
    resize(new Vector2f(164, 740));
   
    fImages = PointClikiGame.resourceManager().spritesheet("editor/smarts", 32, 32);
   
    fTilesetMenu = new DropDownMenu(new Minion<SelectionEvent>() {
      @Override
      public long run(Dispatcher<SelectionEvent> dispatcher, String type, SelectionEvent event) {
        updateTiles();
        return Minion.CONTINUE;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.