Package de.kopis.jusenet.ui.menu

Examples of de.kopis.jusenet.ui.menu.GroupPopupMenu


            public void mousePressed(MouseEvent e) {
                if(SwingUtilities.isRightMouseButton(e)) {
                    if(allGroupList.getSelectedValue() != null) {
//                        GuiUtils.showError("show group popup");
                        //TODO select value under mouse
                        GroupPopupMenu popup = new GroupPopupMenu();
                        popup.setLocation(e.getPoint());
                        popup.show((Component) e.getSource(), e.getX(), e.getY());
                    }
//                    else {
//                        GuiUtils.showError("no selection!");
//                    }
                }
            }
            });
        groupTabs.addTab("All", new JScrollPane(allGroupList));

        newGroupList = new JList(newgroupmodel);
        newGroupList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        newGroupList.setCellRenderer(new GroupCellRenderer());
        newGroupList.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                   if(e.getValueIsAdjusting()) return;
                  
                   Group g = (Group) newGroupList.getSelectedValue();
                   if(g == null) return;
                  
                   displayArticles(g.getId());
            }});
        newGroupList.addMouseListener(new MouseAdapter() {
            public void mousePressed(MouseEvent e) {
                if(SwingUtilities.isRightMouseButton(e)) {
                    if(newGroupList.getSelectedValue() != null) {
//                        GuiUtils.showError("show group popup");
                        //TODO select value under mouse
                        GroupPopupMenu popup = new GroupPopupMenu();
                        popup.setLocation(e.getPoint());
                        popup.show((Component) e.getSource(), e.getX(), e.getY());
                    }
//                    else {
//                        GuiUtils.showError("no selection!");
//                    }
                }
            }
            });
        groupTabs.addTab("New", new JScrollPane(newGroupList));

        subscribedGroupList = new JList(subscribedgroupmodel);
        subscribedGroupList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        subscribedGroupList.setCellRenderer(new GroupCellRenderer());
        subscribedGroupList.addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                   if(e.getValueIsAdjusting()) return;

                   final Group g = (Group) subscribedGroupList.getSelectedValue();
                   if(g == null) return;
                  
                   displayArticles(g.getId());
            }});
        subscribedGroupList.addMouseListener(new MouseAdapter() {
            public void mousePressed(MouseEvent e) {
                if(SwingUtilities.isRightMouseButton(e)) {
                    if(subscribedGroupList.getSelectedValue() != null) {
//                        GuiUtils.showError("show group popup");
                        //TODO select value under mouse
                        GroupPopupMenu popup = new GroupPopupMenu();
                        popup.setLocation(e.getPoint());
                        popup.show((Component) e.getSource(), e.getX(), e.getY());
                    }
//                    else {
//                        GuiUtils.showError("no selection!");
//                    }
                }
View Full Code Here

TOP

Related Classes of de.kopis.jusenet.ui.menu.GroupPopupMenu

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.