Package org.zkoss.zul

Examples of org.zkoss.zul.Menuitem


    menuBar.setVisible(true);

    // generate the menu from the menuXMLFile
    getDropDownMenuFactory().addMenu(menuBar);

    final Menuitem changeToTreeMenu = new Menuitem();
    changeToTreeMenu.setLabel(Labels.getLabel("menu_Item_backToTree"));
    changeToTreeMenu.setImage("/images/icons/refresh2_yellow_16x16.gif");
    changeToTreeMenu.setParent(menuBar);
    changeToTreeMenu.addEventListener("onClick", new EventListener() {
      @Override
      public void onEvent(Event event) throws Exception {
        // get an instance of the borderlayout defined in the
        // index.zul-file
        final Borderlayout bl = (Borderlayout) Path.getComponent("/outerIndexWindow/borderlayoutMain");
View Full Code Here


  }
 
  private void applyDisabled(List children, boolean disabled) {
    for (Object obj : children) {
      if (obj instanceof Menuitem) {
        Menuitem menu = (Menuitem)obj;
        menu.setDisabled(disabled);
      }
    }
  }
View Full Code Here

    formatNumber.setDisabled(disable);
  }
  private void applyDisabled(List children, boolean disabled) {
    for (Object obj : children) {
      if (obj instanceof Menuitem) {
        Menuitem menu = (Menuitem)obj;
        menu.setDisabled(disabled);
      }
    }
  }
View Full Code Here

    @Listen("onSniffMenu=window")
    public void sniffMenu() {
        List<Menuitem> mis = ComponentUtil.find(Menuitem.class, menu, 16);
        for (Iterator<Menuitem> iterator = mis.iterator(); iterator.hasNext(); ) {
            Menuitem mi = iterator.next();
            mi.addEventListener("onClick", new EventListener<Event>() {
                @Override
                public void onEvent(Event event) throws Exception {
                    Events.echoEvent("onInterceptMenu", self, event.getTarget());
                }
            });
View Full Code Here

public class OptionBinder {
 
 
 
  public static void bindStandardOptions(final Window source, final String gridName, final String targetWindow){
    Menuitem createItem =(Menuitem)source.getFellow("createItem");
    createItem.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        openDetails(source, gridName, "1", targetWindow);
        Events.postEvent("onRefresh", source, null);
       
      }
    });
    Menuitem showItem =(Menuitem)source.getFellow("showItem");
    showItem.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        openDetails(source, gridName, "2", targetWindow);
        Events.postEvent("onRefresh", source, null);
       
      }
    });    Menuitem editItem=(Menuitem)source.getFellow("editItem");
    editItem.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        openDetails(source, gridName, "3", targetWindow);
        Events.postEvent("onRefresh", source, null);
       
      }
    });
    Menuitem deleteItem=(Menuitem)source.getFellow("deleteItem");
    deleteItem.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        openDetails(source, gridName, "4", targetWindow);
        Events.postEvent("refresh", source, null);
      }
    });
View Full Code Here

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

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

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

            this.icon = icon;
            this.action = action;
        }

        Menuitem createMenuItem() {
            Menuitem result = new Menuitem();
            result.setLabel(name);
            if (icon != null) {
                result.setImage(icon);
            }
            return result;
        }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Menuitem

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.