1. #1
    Ext GWT Premium Member
    Join Date
    Oct 2008
    Posts
    72
    Vote Rating
    5
    elirov is on a distinguished road

      0  

    Default setContextMenu() on TabItem.getHeader() or MenuItem

    setContextMenu() on TabItem.getHeader() or MenuItem


    Why is HeaderItem.setContextMenu() protected? It's hard to add right-click menus to tab items that way...

    Also, I'm trying to add a context menu to a MenuItem, but when I right-click on the MenuItem, I don't seem to get into the onRightClick() method of the MenuItem. The debugger goes right into the onRightClick() method of the Menu itself. It seems like onRightClick() doesn't trigger for MenuItems.

    Here's the code:
    Code:
                MenuItem contextMenuItemRip = new MenuItem();
                contextMenuItemRip.setText("Tear Off");
                contextMenuItemRip.addSelectionListener(new SelectionListener<ComponentEvent>() {
                    public void componentSelected(ComponentEvent event) {
                        com.google.gwt.user.client.Window.open(linkURL, "_blank", "scrollbars=yes,toolbar=no,resizable=yes,menubar=no,directories=no");
                    }
                });
                menu.add(contextMenuItemRip);
                getHeader().setContextMenu(menu); // NOT WORKING DUE TO VISIBILITY
    And the other:
    Code:
        class TabsetMenuItem extends MenuItem {
            public TabsetMenuItem(final String tabsetName) {
                Menu menu = new Menu();
                menu.setShadow(false);
                MenuItem del = new MenuItem();
                del.setText("Delete");
                del.setTitle("Delete");
                del.addSelectionListener(new SelectionListener<ComponentEvent>() {
                    public void componentSelected(ComponentEvent ev) {
                        deleteTabset(tabsetName);
                    }
                });
                menu.add(del);
                setContextMenu(menu);
            }
        }
    Last edited by mystix; 3 Nov 2008 at 11:43 PM. Reason: post code in [code][/code] tags. see http://extjs.com/forum/misc.php?do=bbcode#code

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar