Examples of ClosableTabComponent


Examples of cz.cuni.mff.inetpaint.communications.swing.ClosableTabComponent

    private int addCommunication(final AbstractCommunication communication) {
        if(!showedCommunications.contains(communication)) {
            showedCommunications.add(communication);
           
            final Component component = communication.getComponent();
            final ClosableTabComponent tab = communication.getTabComponent();
           
            commTabs.addTab(communication.getJID(), component);
           
            int index = commTabs.indexOfComponent(component);

            if(index != showedCommunications.indexOf(communication)) {
                throw new AssertionError("Tab-Comm Index consistency corrupted.");
            }
           
            commTabs.setTabComponentAt(index, tab);  
           
            tab.addCloseActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    hideCommunication(communication);
                    tab.removeCloseActionListener(this);
                }
            });
        }

        return showedCommunications.indexOf(communication);
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.