Package org.noos.xing.mydoggy.plaf.ui.content

Examples of org.noos.xing.mydoggy.plaf.ui.content.ContentUI


                }

                dialog.addWindowListener(new WindowAdapter() {
                    public void windowClosing(WindowEvent event) {
                        Component component = dialog.getContentPane().getComponent(0);
                        ContentUI content = (ContentUI) contentManager.getContent(component);
                        content.fireSelected(false);
                        content.setDetached(false);
                    }
                });

                dialog.addWindowFocusListener(new WindowFocusListener() {
                    public void windowGainedFocus(WindowEvent e) {
                        ContentUI content = (ContentUI) contentManager.getContent(dialog.getContentPane().getComponent(0));
                        content.fireSelected(true);
                    }

                    public void windowLostFocus(WindowEvent e) {
                        if (dialog.getContentPane().getComponentCount() > 0) {
                            ContentUI content = (ContentUI) contentManager.getContent(dialog.getContentPane().getComponent(0));
                            content.fireSelected(false);
                        }
                    }
                });

                if (parentFrame == null) {
                    WindowFocusListener windowFocusListener = new WindowFocusListener() {
                        long start;
                        long end;

                        public void windowGainedFocus(WindowEvent e) {
                            start = System.currentTimeMillis();
                        }

                        public void windowLostFocus(WindowEvent e) {
                            end = System.currentTimeMillis();
                            long elapsed = end - start;
                            //System.out.println(elapsed);
                            if (elapsed < 100)
                                dialog.toFront();

                            dialog.removeWindowFocusListener(this);
                        }
                    };
                    dialog.addWindowFocusListener(windowFocusListener);
                }

                dialog.toFront();
                dialog.setVisible(true);
                SwingUtil.requestFocus(dialog);
            } else if (oldValue && !newValue) {
                Window window = SwingUtilities.windowForComponent(content.getComponent());
                window.setVisible(false);
                window.dispose();

                addUIForContent(content);
                tabbedContentManager.setSelectedIndex(tabbedContentManager.getTabCount() - 1);
View Full Code Here

TOP

Related Classes of org.noos.xing.mydoggy.plaf.ui.content.ContentUI

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.