Package org.zkoss.zul

Examples of org.zkoss.zul.Menupopup


  @Override
  protected MenuFactoryDto createMenuComponent(Component parent, boolean open) {
    final DefaultDropDownMenu menu = new DefaultDropDownMenu();
    parent.appendChild(menu);

    final Menupopup menupopup = new Menupopup();
    menu.appendChild(menupopup);

    return new MenuFactoryDto(menupopup, menu);
  }
View Full Code Here


  private void createMenubar() {
    Menubar menubar=(Menubar)getFellow("menubar");
    Menu actionsMenu=new Menu("Actions");
    menubar.appendChild(actionsMenu);
    Menupopup popup=new Menupopup();
    actionsMenu.appendChild(popup);
    Menuitem createItem =new Menuitem("Create");
    createItem.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        Map<String, ArrayList<String>> map=new HashMap<String, ArrayList<String>>();
        ArrayList<String> options=new ArrayList<String>();
        options.add("create");
        map.put("options", options);
        openDetails(map);
       
      }
    });
    Menuitem showItem =new Menuitem("Show");
    showItem.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        Map<String, ArrayList<String>> map=new HashMap<String, ArrayList<String>>();
        ArrayList<String> options=new ArrayList<String>();
        options.add("show");
        map.put("options", options);
        openDetails(map);
       
      }
    });
    Menuitem editItem=new Menuitem("Edit");
    editItem.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        Map<String, ArrayList<String>> map=new HashMap<String, ArrayList<String>>();
        ArrayList<String> options=new ArrayList<String>();
        options.add("edit");
        map.put("options", options);
        openDetails(map);
       
      }
    });
    Menuitem deleteItem=new Menuitem("Delete");
    deleteItem.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        Map<String, ArrayList<String>> map=new HashMap<String, ArrayList<String>>();
        ArrayList<String> options=new ArrayList<String>();
        options.add("delete");
        map.put("options", options);
        openDetails(map);
       
      }
    });
    popup.appendChild(createItem);
    popup.appendChild(showItem);
    popup.appendChild(editItem);
    popup.appendChild(deleteItem);
    appendChild(menubar);
   
   
  }
View Full Code Here

  private void createMenubar() {
    Menubar menubar=(Menubar)getFellow("menubar");
    Menu actionsMenu=new Menu("Actions");
    menubar.appendChild(actionsMenu);
    Menupopup popup=new Menupopup();
    actionsMenu.appendChild(popup);
    Menuitem createItem =new Menuitem("Create");
    createItem.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        Map<String, ArrayList<String>> map=new HashMap<String, ArrayList<String>>();
        ArrayList<String> options=new ArrayList<String>();
        options.add("create");
        map.put("options", options);
        openDetails(map);
       
      }
    });
    Menuitem showItem =new Menuitem("Show");
    showItem.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        Map<String, ArrayList<String>> map=new HashMap<String, ArrayList<String>>();
        ArrayList<String> options=new ArrayList<String>();
        options.add("show");
        map.put("options", options);
        openDetails(map);
       
      }
    });
    Menuitem editItem=new Menuitem("Edit");
    editItem.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        Map<String, ArrayList<String>> map=new HashMap<String, ArrayList<String>>();
        ArrayList<String> options=new ArrayList<String>();
        options.add("edit");
        map.put("options", options);
        openDetails(map);
       
      }
    });
    Menuitem deleteItem=new Menuitem("Delete");
    deleteItem.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        Map<String, ArrayList<String>> map=new HashMap<String, ArrayList<String>>();
        ArrayList<String> options=new ArrayList<String>();
        options.add("delete");
        map.put("options", options);
        openDetails(map);
       
      }
    });
    popup.appendChild(createItem);
    popup.appendChild(showItem);
    popup.appendChild(editItem);
    popup.appendChild(deleteItem);
    appendChild(menubar);
   
   
  }
View Full Code Here

    public Menupopup create() {
        return create(true);
    }

    private Menupopup create(boolean setContext) {
        Menupopup result = new Menupopup();
        result.addEventListener("onOpen", new EventListener() {

            @Override
            public void onEvent(Event event) {
                OpenEvent openEvent = (OpenEvent) event;
                referenced = (T) openEvent.getReference();
            }
        });
        for (final Item item : items) {
            if (!item.name.equals("separator")) {
                Menuitem menuItem = item.createMenuItem();
                menuItem.addEventListener("onClick", new EventListener() {
                    @Override
                    public void onEvent(Event event) {
                        ItemAction<T> action = item.action;
                        action.onEvent(referenced, event);
                    }
                });
                result.appendChild(menuItem);
            } else {
                Menuseparator separator = new Menuseparator();
                result.appendChild(separator);
            }
        }
        insertInRootComponent(result);
        if (setContext) {
            for (T element : elements) {
View Full Code Here

                        public void onEvent(Div choosen, Event event) {
                            schedule(loadLine);
                        }
                    });

            Menupopup result = menuBuilder.createWithoutSettingContext();
            contextMenus.put(div, result);
            return result;

        }
        return contextMenus.get(div);
View Full Code Here

                if (command.accepts(taskComponent)) {
                        menuBuilder.item(command.getName(), command.getIcon(),
                            command.toItemAction());
                }
            }
            Menupopup result = menuBuilder.createWithoutSettingContext();
            contextMenus.put(taskComponent, result);
            return result;
        }
        return contextMenus.get(taskComponent);
    }
View Full Code Here

            dependencyComponent.redrawDependency();
        }
    }

    private void addContextMenu(DependencyComponent dependencyComponent) {
        Menupopup contextMenu = dependencyComponent.hasLimitingTasks() ?
                getLimitingContextMenu()
                : getContextMenu();
        dependencyComponent.setContext(contextMenu);
    }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Menupopup

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.